My page:
CSS:Code:<! DOCTYPE HTML PUBLIC "//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="author" content="Petar Nikic"> <meta name="description" content="tutorijali"> <meta name="keywords" content="education, tutorials"> <link rel="stylesheet" href="css/stil.css"> <title>Serbian IT Education </title> <script type="text/javascript"> </script> </head> <body> <form> <input type="text" id="search" /><input type="button" value="Search" onClick="get();" /> </form> <ul id="nav"> <li><a href="#">Pocetna</a></li> <li><a href="#">Pocetna</a></li> <li><a href="#">Pocetna</a></li> <li><a href="#">Pocetna</a></li> </ul> <div id="content"> <div class="box"> <center><h2>Dobro Dosli</h2></center> <img class="alignleft" src="CSS/slike/cvet.jpg" width="200" height="200" alt="" /> <p id="a"> This website is developed by <strong>PETAR NIKIC</strong> the content is about computer programming and practice skill for <u>FREE</u> Greets to <strong><u>ALEKSANDAR ARSIC</strong></u> </p> <div id="content2"> <div class="box"> <center><h2>Tutorial By: ALEKSANDAR ARSIC</h2></center> <center><iframe width="560" height="315" src="http://www.youtube.com/embed/usQk-rEvQMs" frameborder="0" allowfullscreen></iframe></center> </div> </div> </div> </div> </body>
The problem is I need javascript code to search for word that user enter and highlight that word with light yellow color. I looked all over the internet for solutions but just none of them work.Code:body{ background-color:#E8E8E8; font-family:Tahoma; background-image:url(slike/Cover.jpg); background-repeat:repeat-x; } #container{ text-align:center; margin:5px; } #nav { width:100%; padding:0px; list-style-type:none; } #nav li{ position:relative; top:30px; left:50px; color:white; list-style-type:none; padding:0px; text-align:center; width: 80px; float:left; } #nav li a { color:#C4C0C0; text-decoration:none; -webkit-transition-duration: .4s; opacity:0.8; } #nav li a:hover{ text-decoration:none; color:#FFC400; cursor:pointer; } #content{ padding:32px; background-color:#FFF; position:absolute; top:200px; left:120px; width:680px; height:400px; border:1px solid #BDBDBD; float:left; } .box{ margin: 0 0 40px 0; } img.alignleft { float: left; margin: 5px 20px 20px 0; } #content2{ background-color:#FFF; padding:32px; position:absolute; width:680px; height:400px; top:464px; left:-1px; border:1px solid #BDBDBD; float:left; margin:auto; } #search { height:30px; width:200px; position:relative; margin-top: 10px; margin-left:80%; background-color:#453c35; border:1px solid #453c35; color:#ffffff; } .highlight { background-color:yellow; }




Reply With Quote