Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/09/2010, 10:08
Avatar de _cronos2
_cronos2
Colaborador
 
Fecha de Ingreso: junio-2010
Mensajes: 2.062
Antigüedad: 13 años, 11 meses
Puntos: 310
Respuesta: Ayuda con este javascript Urge!

Código Javascript:
Ver original
  1. function searchBox(active, txt, comprobar) {
  2. var searchKey = document.getElementById('searchBox').value;
  3. document.getElementById('searchBox').className = 'searchBox' + active;
  4. document.getElementById('searchBox').value = (document.getElementById('searchBox').value == comprobar) ? txt : comprobar ;
  5. }
  6.  
  7. function searchId(){
  8.  
  9. var searchKey = document.getElementById('searchBox').value;
  10.  
  11. window.location.href = 'http://mipagina.com#' + searchKey;
  12. }
Código HTML:
Ver original
  1. <input id="searchBox" value="Buscar" onfocus="searchBox('On', '', 'Buscar')" onblur="searchBox('Off', 'Buscar', '')">
  2. <input type="button" value="Buscar" onclick="searchId()">

Saludos (:
__________________
" Getting older’s not been on my plans
but it’s never late, it’s never late enough for me to stay. "
Cigarettes - Russian Red