test.html (1437B)
1 <!-- This Source Code Form is subject to the terms of the Mozilla Public 2 - License, v. 2.0. If a copy of the MPL was not distributed with this 3 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 4 5 <!DOCTYPE html> 6 <html> 7 <head> 8 <title>Marionette Test</title> 9 <style> 10 input[type=text], input[type=button] { 11 appearance: none; 12 } 13 </style> 14 </head> 15 <body> 16 <h1 id="testh1">Test Page</h1> 17 <script type="text/javascript"> 18 window.ready = true; 19 function addDelayedElement() { 20 setTimeout(createDiv, 2000); 21 function createDiv() { 22 let newDiv = document.createElement("div"); 23 newDiv.id = "newDiv"; 24 let newContent = document.createTextNode("I am a newly created div!"); 25 newDiv.appendChild(newContent); 26 document.body.appendChild(newDiv); 27 } 28 } 29 function clicked() { 30 let link = document.getElementById("mozLink"); 31 link.innerHTML = "Clicked"; 32 } 33 </script> 34 <a href="#" id="mozLink" class="linkClass" onclick="clicked()">Click me!</a> 35 <div id="testDiv"> 36 <a href="#" id="divLink" class="linkClass" onclick="clicked()">Div click me!</a> 37 <a href="#" id="divLink2" class="linkClass" onclick="clicked()">Div click me!</a> 38 </div> 39 <input name="myInput" type="text" value="asdf"/> 40 <input name="myCheckBox" type="checkbox" /> 41 <input id="createDivButton" type="button" value="create a div" onclick="addDelayedElement()" /> 42 </body> 43 </html>