I recently found that the javascript code below, works !
function a(){
alert(myInput.value);
}
<input type="text" value="That`s new to me" id="myInput"/>
<input type="button" onclick="javascript:a();"/>
What is new to me, is the ability to reach and use an input VALUE, without using the getElementById funcion.
Is it common to use this way of coding ? What are the pros and cons of this coding ?
TNX Amitai