How to make word searcher using html

My name is Ritesh. I know html, js, java, php, python, css, c#, c++, etc, computer languages

Following is the source code: <html> <head> <script> document.addEventListener('DOMContentLoaded', function(){ var searchpc=document.getElementById("search_pc").innerHTML; searchpc=searchpc.toString(); document.getElementById("search").onclick = function(){ highlight_word(searchpc) }; },false); function highlight_word(searchpc){ var text=document.getElementById("search_word").value; if(text){ var pattern=new RegExp("("+text+")","gi"); var new_text=searchpc.replace(pattern,"<mark>"+text+"</mark>"); document.getElementById("search_pc").innerHTML=new_text; } } </script> </head> <body> <div id="wrapper"> <input type="text" id="search_word"> <input type="button" value="search" id="search"> <div> <p id="search_pc">My name is Ritesh. I know html, js, java, php, python, css, c#, c++, etc, computer languages</p> </div> </div> </body> </html>

My website link.

Make more than 20$.

Start freelancing & Earn money

Make upto $10 by only sign uping.

Make $50 for free by sharing ads.

Panasonic eluga x1 Pro

Comments

Popular posts from this blog

Download full version pc games for free

How to set background color on a html document