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 -

linux - gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now -

sql - MySQL - Finding Empty relations -