javascript - Changing a value of a html tag -


i using inside page <span> tag

<span class="class_name">1500</span> 

and have javascript code change "1500" 15%

my question how read number inside span , print new number
want example code.

try this

<span id="thisspan" class="whateverclass">1500</span> <div id="thevalueis"></div> <script>    document.getelementbyid("thevalueis").innerhtml=document.getelementbyid("thisspan").innerhtml; </script>  

i hope got question right. :)


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -