html - How do i make my search bar actually search pages in my site? -


i put search bar website don't know how make search pages within site. don't want google search bar can search anything. have search bar in site, nothing happens when press search. appreciated.

here html search bar:

<div class="search">     <form class="form-wrapper-2 cf">         <input type="text" placeholder="search yacht..." required>         <button type="submit">search</button>     </form> </div> 

here's sample html form code search bar:

<form id="sarchform" class="search2" method="get" action="source.html" /> <input class="search2" id="test" type="text" name="search" size="10" maxlength="255"/> 

here's js code:

<script type="text/javascript"> document.getelementbyid('searchform').onsubmit = function() {     window.location = 'http://www.google.com/search?q=site:yourdomainname ' + document.getelementbyid('test').value;     return false; } </script> 

mention domain name in code above , try implementing this.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -