<html>
<body id="b1">
<p id="a">webmakers.com</p>
<script>
function f1()
{
var newH=document.createElement("h1");
var node=document.createTextNode("Yash Singh");
newH.appendChild(node);
var body=document.getElementById("b1");
body.appendChild(newH);
}
</script>
<button type="button" onclick="f1()">Adds Header Element to body</button>
Thanks
Happy programming!
<body id="b1">
<p id="a">webmakers.com</p>
<script>
function f1()
{
var newH=document.createElement("h1");
var node=document.createTextNode("Yash Singh");
newH.appendChild(node);
var body=document.getElementById("b1");
body.appendChild(newH);
}
</script>
<button type="button" onclick="f1()">Adds Header Element to body</button>
Thanks
Happy programming!
ReplyDeleteI’m glad to see it featured here,Nice blog, I really apprecialte the way you are sharing your experiences,Thank you for sharing about this information. That’s nice and interesting, I like it. IGNOU Courses
IGNOU Study Material
IGNOU Syllabus
IGNOU Assignments
IGNOU Study Center
IGNOU MBA Study Material