How to get text box value in JavaScript

前端 未结 15 1768
面向向阳花
面向向阳花 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 14:53

    +1 Gumbo: ‘id’ is the easiest way to access page elements. IE (pre version 8) will return things with a matching ‘name’ if it can't find anything with the given ID, but this is a bug.

    i am getting only "software".

    id-vs-name won't affect this; I suspect what's happened is that (contrary to the example code) you've forgotten to quote your ‘value’ attribute:

    
    

提交回复
热议问题