Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/06/2009, 06:21
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 10 meses
Puntos: 574
Respuesta: Iluminar input button

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>solo numeros</title>
<script language="JavaScript" type="text/JavaScript">
function cambia(){
	document.getElementById('abopro').style.backgroundColor = "#f8e603";
	}
	
function vuelve(){
	document.getElementById('abopro').style.backgroundColor = "#fbf0ce";
	}

</script>
<style type="text/css">
<!--
.botoncolor {
background-color: #fbf0ce;
color:  #474201;
font-family: Arial;
font-size: 11px;
border: 1px solid #f8e603;
width:90%;
display:block;
text-decoration: none;
font-weight: bold;
padding: 3px;
margin-bottom: 4px;
}
-->
</style>
</head>
<body>
<div align='left' ><input type="submit"  id="abopro" name="abopro" value="Abogados & Procuradores" onmouseover="cambia()" onMouseOut="vuelve()" class="botoncolor" /></div>

</body>
</html> 
No he cambiado casi nada... solo he puesto los # en el color y he sacado la definicion del style fuera del tag... cosa harto aconsejable solo por la comodidad de trabajar en distintas lieneas... ademas es reutilizable... incluso lo pondria en un .css....

Ha IMPORTATE si usas document.getElementById(....) hay que poner id a las cosas ( id="abopro") aún que parezca reiterativo con el name="abopro"...

Si he tocado cosas...

Quim