Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/12/2011, 14:43
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: 2 funciones con 1 solo botón

prueba así
Cita:
<!--
function SetImage(id, filename)
{
var elem=document.getElementById(id);
if(elem)
{
elem.src=filename;
}
}

function pruebaClic()
{
alert("¡ El botón ha sido pulsado !");
}

function init()
{
document.form1.Button1.onclick= function() {pruebaClic(); SetImage('Shape1','img1.png'); SetImage('Shape2','img2.png');}
}


window.onload=init;
//-->


<FORM name=form1>
<input type="button" id="Button1" name="pepe" value="Submit" style="position:absolute;left:277px;top:260px;widt h:96px;height:25px;font-family:Arial;font-size:13px;z-index:0">
<div id="wb_Shape1" style="margin:0;padding:0;position:absolute;left:5 45px;top:290px;width:92px;height:55px;text-align:center;z-index:1;">
<img src="img3.png" id="Shape1" alt="" title="" style="border-width:0;width:92px;height:55px;" /></div>
<div id="wb_Shape2" style="margin:0;padding:0;position:absolute;left:5 37px;top:224px;width:86px;height:35px;text-align:center;z-index:2;">
<img src="img3.png" id="Shape2" alt="" title="" style="border-width:0;width:86px;height:35px;" /></div>
</FORM>
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}