简体   繁体   English

如何在html中将一个文本字段交换到另一个文本字段?

[英]how to swap one text field to another in html?

In above image enter from and to field then 在上面的图像然后输入和到字段
click the arrow it will change value in page from value is stored in to and to value is stored in from want code for swap that text box value in html 单击箭头它将更改页面中的值从值存储到和值存储在希望代码中用于交换html中的文本框值

hard to understand your question but maybe this one you want . 很难理解你的问题,但也许这个你想要的。

<input type="text" id="f1">
<input type="text" id="f2">
<input type="button" id="b1" value="interchange">

$(document).ready(function(){
   $("#id1").click(function(){
     var f1 = $("#f1").val();
      $("#f2").val(f1);
   })
})

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从另一个文本字段中的一个文本字段中看到文本? - How to see text from one text field in another text field? 如何基于另一个输入文本字段(在另一个html表中)的特定值更改一个输入文本字段(在一个html表中)的值 - how to change value of one input text field (in one html table) based on a specific value of another input text field (present in another html table) 如何使用JavaScript将文本从一个字段复制到另一个字段? - How To Use JavaScript To Copy Text From One Field To Another? 如何使用JavaScript将文本从一个字段复制到另一个字段 - How To Use JavaScript To Copy Text From One Field To Another 如何用jQuery中另一个文本字段的值替换一个文本字段的一部分? - How to replace part of one text field with a value from another text field in jQuery? 如何根据另一个输入文本字段的特定值更改一个输入文本字段的值 - how to change value of one input text field based on a specific value of another input text field 如何使用Java脚本验证html文本字段以确保文本字段中包含的单词不超过一个 - how to validate html text field using java script to ensure no more than one word contain in text field 用户单击时如何将一个SVG交换为另一个SVG - How to swap one SVG for another SVG when the user clicks on it 如何在移动视图css中互相交换div - how to swap div with one another in mobile view css 如何使用lodash将数组元素从一个位置交换到另一个位置? - How to swap array element from one position to another using lodash?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM