| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <p>Testing cloneNode(true) on textarea element works correctly</p> | |
| 5 <p>Before clone</p> | |
| 6 <textarea name="" id="textarea1" cols="15" rows="2">InitialText</textarea> | |
| 7 <textarea name="" id="textarea2" cols="15" rows="2">InitialText</textarea> | |
| 8 <textarea name="" id="textarea3" cols="15" rows="2">InitialText</textarea> | |
| 9 <p>After clone</p> | |
| 10 <script> | |
| 11 // cloning text | |
| 12 var textarea1 = document.getElementById('textarea1'); | |
| 13 document.body.appendChild(textarea1.cloneNode(true)); | |
| 14 | |
| 15 // User input | |
| 16 var textarea2 = document.getElementById('textarea2'); | |
| 17 textarea2.focus(); | |
| 18 document.execCommand('InsertText', false, 'InsertedText '); | |
| 19 document.body.appendChild(textarea2.cloneNode(true)); | |
| 20 textarea2.blur(); | |
| 21 | |
| 22 // Updating IDL value | |
| 23 var textarea3 = document.getElementById('textarea3'); | |
| 24 textarea3.value = "NewText"; | |
| 25 document.body.appendChild(textarea3.cloneNode(true)); | |
| 26 </script> | |
| 27 </body> | |
| 28 </html> | |
| OLD | NEW |