JavaScript DHTML/Javascript Collections/controlRange

Материал из Web эксперт
Перейти к: навигация, поиск

"controlRange" Example

   <source lang="html4strict">
   

<html> <body> <script> function loadform(){

   var elem = document.createElement("<input id="test" type="text" value="testing">")
   document.body.insertBefore(elem);
   var range = document.body.createControlRange();
   range.add(document.all.test);
   alert(range.item(0).value); 

} </script> <body> <button onclick="loadform();">Load Control Range on the page</button> </body> </html>


     </source>