'moveToBookmark()' Example : moveToBookmark « Node Operation « JavaScript DHTML






'moveToBookmark()' Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    var m = document.body.createTextRange();
    var n = m.getBookmark();
    m.findText("sample", 6, 2);
    m.select();
    m.moveToBookmark(n);
    m.findText("sample");
    m.select(); 
} 
</script>
<p>This is some sample text<p>
<input type="button" value="MoveToBookmark" onclick="function1();">
</body>
</html>

    
      
      








Related examples in the same category