Javascript element value

Hi all,

For beginners this could be helpful – How to get the value of each element in your page using Javascript?

Lets say you have <div id=”newid”></div>

use this:

var element_value = document.getElementById(&quot;newid&quot;).value;

Hope it helps!

One Comment

  1. Newbie says:

    What is the result of this statement? You should always mention the result of any statement, what it returns etc.

    For example here what is the value of element_value after running this script?

Leave a Reply