topical media & game development

talk show tell print

professional-javascript-10-IERangeExample3.htm / htm



  <html>
      <head>
          <title>IE Range Example</title>
          <script type="text/javascript">
              function useRanges() {
                  var oRange = document.body.createTextRange();
                  var oP1 = document.getElementById("p1");
                  oRange.findText("Hello");
                  oRange.pasteHTML("<em>Howdy</em>");
              }
          </script>
      </head>
      <body><p id="p1"><b>Hello</b> World</p>
          <input type="button" value="Use Ranges" onclick="useRanges()" />  
          <p><strong>Note:</strong> This example uses Internet Explorer ranges and will only work on Internet Explorer.</p>
        
      </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.