Javascript examples for DOM:Element textContent
Get text inside one span tag to another span tag
<html> <head></head> <body> <div> <span>40.78</span> </div> <span id="test"></span> <script> var span = document.getElementsByTagName("span")[0]; var test = document.getElementById( 'test' ); test.textContent = span.textContent; console.log(test.textContent); /*from w w w . ja v a2s . c o m*/ </script> </body> </html>