How to get text box value in JavaScript

前端 未结 15 1770
面向向阳花
面向向阳花 2020-12-07 14:43

I am trying to use JavaScript to get the value from an HTML text box but value is not coming after white space

For example:



        
15条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 15:01

    This should be simple using jquery:

    HTML:

      
    

    JS:

      var jobValue = $('#txtJob').val(); //Get the text field value
      $('#txtJob').val(jobValue);        //Set the text field value
    

提交回复
热议问题