Monday, February 26, 2018

javaScript : Adding an HTML element to your webpage

<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!

1 comment:


  1. I’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

    ReplyDelete

Query for finding high dividend paying stocks

 Post the following query in Screen.in, to get list of high dividend yield stocks: Dividend yield > 6 AND Dividend last year > 1000 AN...