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






'findText()' Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    var m = document.body.createTextRange();
    m.findText('"test"');
    m.select(); 
} 
</script>
<p>Search the "test" word in this paragraph</p>
<button onclick="function1();">Find test</button>
</body>
</html>

    
      
      








Related examples in the same category