JS

mik -  
 HackTrack -
j'ai besoin d'un script pour les categorie d'un site.
j'ai prepare dex bouton (ex:1,2).
je veux que quand on passe la souris (mouseoveron)
le bouton se change de 1 a 2.

kkun peux me guider?
merci.

1 réponse

  1. HackTrack
     
    Voici la solution:

    <html>
    <head><title>TestJavascript</title></head>
    <script language="JavaScript">

    <!--
    function changeValue(num){
    if(num=="1"){
    return "2";
    }else if(num=="2"){
    return "1";
    }
    }
    -->
    </script>

    <body>
    <form name="myForm" action="Ok.html" method ="POST">
    <input type="submit" name="myButton" value="1" onMouseOver="this.value= changeValue(this.value)" onMouseOut="this.value= changeValue(this.value)" />
    </form>

    <button name="mySecondButton" value="1" onMouseOver="this.value= changeValue(this.value)" onMouseOut="this.value= changeValue(this.value)" >1</button>
    </body>

    </html>

    ;-)
    0