How does the value attribute work for an html input tag after editing through an input field?
Example:
<input type="text" name="test" id="test" value="Hello world" />
an input window appears with the text "Hello world". If I edit it by entering a new line into the processed text field (and not through the source code), and then try to get its value using js, like this
alert(document.getElementById('test').value)
I, correctly, get a new meaning. But if I check the item through the developer’s chrome tools (or firebug, or whatever you prefer), I will see the same “Hello world” line as it was at the beginning.
Which of the two are correct? js or chrome inspector?
Here is an example script and here is a screenshot
, : , X, X. , : OLD NEW val , , . /.
, attr. "" "" , , , .
- ? "" - ?