an example for innerHTML and getElementById
I need an example how can i use innerHTML and getElementbyId to store the data in to element.
Add Comment
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Updating,Adding Content into Elements using Javascript</title>
<style type="text/css">
.conc{
font-size:50px;
}
#cont{
color:#33E300;
}
</style>
<script type="text/javascript">
document.write("<p class='conc'>India</p>");
function runmyjavaScript(){
var cc = document.getElementById('cont');
cc.innerHTML = "I love India";
}
</script>
</head>
<body onLoad="runmyjavaScript()">
<p id="cont"></p>
</body>
</html>