Código Javascript
:
Ver originalfunction searchBox(active, txt, comprobar) {
var searchKey = document.getElementById('searchBox').value;
document.getElementById('searchBox').className = 'searchBox' + active;
document.getElementById('searchBox').value = (document.getElementById('searchBox').value == comprobar) ? txt : comprobar ;
}
function searchId(){
var searchKey = document.getElementById('searchBox').value;
window.location.href = 'http://mipagina.com#' + searchKey;
}
Código HTML:
Ver original<input id="searchBox" value="Buscar" onfocus="searchBox('On', '', 'Buscar')" onblur="searchBox('Off', 'Buscar', '')"> <input type="button" value="Buscar" onclick="searchId()">
Saludos (: