We would like to know how to pass DOM Value to Inner HTML.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!--from ww w .j av a 2s . c o m-->
var x=document.getElementById("mainTitle1").innerHTML;
document.getElementById("mainTitle").innerHTML=x;
}
</script>
</head>
<body>
<span id="mainTitle"></span>
<span style="display: none;" id="mainTitle1">Text Content</span>
</body>
</html>
The code above is rendered as follows: