javascript - Native js input automatically modifies the value of another input when one value changes
淡淡烟草味
淡淡烟草味 2017-06-28 09:28:47
0
6
1049

When one value of native js input changes, automatically modify the value of another input? TKS

淡淡烟草味
淡淡烟草味

reply all(6)
学习ing

You can use input and chagne, probably the timing of triggering is different http://jsrun.net/7UYKp

When using input in IE, propertychange must be added to avoid incompatibility. Then there is another way is data binding. The general solution is to have an object with getter and setter methods, and then change the object when inputting, trigger the setter and then change all the associated ones.

某草草

Bind the onChange event to the input, and modify the value of another input in the onChange event

某草草

Just add dom to the onchange function. Just define it yourself for specific needs

代言

Just use onchange

为情所困

Use change event

曾经蜡笔没有小新

$('#input1').bind('input propertychange', function() {

$('#input2').val(this.value);  

});

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template