I think there is a problem with my functions. Basically when I click on the search bar, I have to delete the text "Search..." rather than being able to type over it.
function active(){
var searchBar = document.getElementById('searchBar');
if(searchBar.value == 'Search...')
{
searchBar.value = '';
searchBar.placeholder = 'Search...';
}
}
function inactive(){
var searchBar = document.getElementById('searchBar');
if(searchBar.value == '')
{
searchBar.value = 'Search...';
searchBar.placeholder = '';
}
}
<form action="search.php" method="post">
<input type="text" id="searchBar" placeholder="" value="Search..." maxlength="30" autocomplete="on" onMouseDown="active();" onBlur="inactive();"/><input type="submit" id="searchBtn" value="Go!" />
</form>