0

have a look at this, 1.) outputs the same as 2.)

What is the downside?, please?

/**
 * 1.) The following: 
 */

alert(my_selector.value)


/**
 * 2.) outputs the same as this:
 */
alert(document.getElementById("my_selector").value)

/**
 * What's ths downside ?
 */
<input type="text" id="my_selector" value="check"/>
daslicht
  • 767
  • 9
  • 24

0 Answers0