How to get text box value in JavaScript

前端 未结 15 1761
面向向阳花
面向向阳花 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:00

    Set id for the textbox. ie,

     
    

    In javascript

    var jobValue = document.getElementById('txtJob').value
    

    In Jquery

     var jobValue =  $("#txtJob").val();
    

提交回复
热议问题