|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <script> |
|
5 |
|
6 function boom() |
|
7 { |
|
8 var root = document.documentElement; |
|
9 while(root.firstChild) { root.removeChild(root.firstChild); } |
|
10 var body = document.createElementNS("http://www.w3.org/1999/xhtml", "body"); |
|
11 body.setAttributeNS(null, "contenteditable", "true"); |
|
12 var img = document.createElementNS("http://www.w3.org/1999/xhtml", "img"); |
|
13 body.appendChild(img); |
|
14 root.appendChild(body); |
|
15 document.removeChild(root); |
|
16 document.appendChild(root); |
|
17 document.execCommand("insertText", false, "5"); |
|
18 document.execCommand("selectAll", false, null); |
|
19 document.execCommand("insertParagraph", false, null); |
|
20 document.execCommand("increasefontsize", false, null); |
|
21 } |
|
22 |
|
23 </script> |
|
24 </head> |
|
25 |
|
26 <body onload="boom();"></body> |
|
27 </html> |