Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body id="mehdi" class ="bodys adalzn alzdnlanz azdnl ndd" name="bod">
- <h1>hallo</h1>
- <script type="text/javascript">
- var x = document.createElement("h2");
- console.log(x);
- x.setAttribute("class","test");
- console.log(x);
- x.id='firstH2';
- console.log(x);
- x.innerHTML = "How are you ";
- console.log(x);
- var father = document.getElementById("mehdi");
- father.appendChild(x);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement