well i make a search function ith javascript that can find a character or a word in a sentence but i want it to select that word or character but it selectall the sentence what can i do? ?
<i> </i>function y(){ var pos=document.getElementById("m1").value.indexOf(document.getElementById("m2").value); if (pos >= 0) alert(document.getElementById("m2").value+" is located at position "+ pos); }