'TextRange' Example : TextRange : Javascript Objects : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP
JavaScript DHTML Home »  Javascript Objects   » [  TextRange  ]   
 



'TextRange' Example

Please note that some example is only working under IE or Firefox.

    
<html>
<head>
<script language="javascript">
function displayText(){
    textRange = document.all.myBody.createTextRange();
    textRange.moveToElementText(myP);
    var m = textRange.text;
    alert(m)

</script>
</head>

<body id="myBody">
<p id="myP">This is some text in the document inside a p element</p>
<button onclick="displayText();">Display the text range</button>
</body>

</html>

    
      
      
Related examples in the same category
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.