'parentTextEdit' Example : parentTextEdit : Node Operation JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Node Operation » parentTextEdit »

 

'parentTextEdit' Example



    
<html>
<body>
<script language="JavaScript">
function function1() {
   var choose, range;
   for (var i = 0; i < document.forms[0].choose.length; i++) {
      if (document.forms[0].choose[i].checked) {
         choose = document.forms[0].choose[i].value;
         break
      }
   }
   var x = window.event.clientX;
   var y = window.event.clientY;
   if (window.event.srcElement.parentTextEdit) {
      range = window.event.srcElement.parentTextEdit.createTextRange()
       range.collapse();
       range.moveToPoint(x, y);
       range.expand(choose);
       range.select();
     }

</script>
<form>
<input type="radio" name="choose" value="character" checked>character
<input type="radio" name="choose" value="word">word
<input type="radio" name="choose" value="sentence">sentence
</form>
<p onClick="function1();"> Some text.</p>
</body>
</html>

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Node Operation
» parentTextEdit