Tuesday, October 22, 2013

Introduction to DOM in Javascript with a basic example

Hello guys! so as always heres is a video and the code with this very simple app that tests out DOM functionality.
Here is the code!
01<!DOCTYPE html>
02<html>
03<head>
04    <script type="text/javascript">
05
06    function test()
07    {
08        var obj = document.getElementById("p1");
09        obj.innerHTML = obj.innerHTML +"<br/> howdy!";
10    }
11
12    </script>
13
14</head>
15<body>
16    <p id="p1">HEllo world</p>
17    <input type="button" onclick="test()" value="Click me!"/>
18</body>
19</html>
DOM tutorial video