Change value of input onchange?

后端 未结 2 611
春和景丽
春和景丽 2020-12-05 04:31

I am trying to create a simple JavaScript function. When someone inserts a number in an input field, the value of another field should change to that value. Her

2条回答
  •  臣服心动
    2020-12-05 05:07

    for jQuery we can use below:

    by input name:

    $('input[name="textboxname"]').val('some value');
    

    by input class:

    $('input[type=text].textboxclass').val('some value');
    

    by input id:

    $('#textboxid').val('some value');
    

提交回复
热议问题