IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

Comment ex�cuter onclick


Sujet :

JavaScript

  1. #1
    Membre r�gulier
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 26
    Localisation : Guin�e

    Informations professionnelles :
    Activit� : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Par d�faut Comment ex�cuter onclick
    Bonjour comment executer onclick dans un button de la page html exemple
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
     <script> var a=prompt("Mot de passe");if(a=="Blazman"||a=="662362050"||a=="1234amdy"||a=="Amdyabou"||a=="Amdy20"||a=="Doreamdy"){alert('Merci')}else{window.location="file:///C:/predefgallery/predefthemes/password.html";};break;alert('No');</script>

  2. #2
    Membre Expert
    Avatar de Doksuri
    Profil pro
    D�veloppeur Web
    Inscrit en
    Juin 2006
    Messages
    2 495
    D�tails du profil
    Informations personnelles :
    �ge : 55
    Localisation : France

    Informations professionnelles :
    Activit� : D�veloppeur Web

    Informations forums :
    Inscription : Juin 2006
    Messages : 2 495
    Par d�faut
    Code javascript : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    var tonElement = document.getElementById('quelqueChose');
    tonElement.addEventListener('click', function() { alert('ok'); });
    La forme des pyramides prouve que l'Homme a toujours tendance a en faire de moins en moins.

    Venez discuter sur le Chat de D�veloppez !

  3. #3
    Membre chevronn�
    Homme Profil pro
    Analyse syst�me
    Inscrit en
    Mai 2014
    Messages
    396
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Arm�nie

    Informations professionnelles :
    Activit� : Analyse syst�me
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Mai 2014
    Messages : 396
    Par d�faut
    Bonjour,

    Vous voulez mettre les mots de passe � la disposition de tous en affichant le code source de la page?

  4. #4
    Membre r�gulier
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 26
    Localisation : Guin�e

    Informations professionnelles :
    Activit� : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Par d�faut
    Bonjour oui je veux le code reel pour realiser un bon calculatrice

  5. #5
    Mod�rateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 211
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Is�re (Rh�ne Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 211
    Par d�faut
    Bonjour,
    j'ai du mal � comprendre ce que tu veux r�ellement faire !!???!!

  6. #6
    Membre r�gulier
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 26
    Localisation : Guin�e

    Informations professionnelles :
    Activit� : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Par d�faut
    Je veux realiser un calculatrice � l'aide des code html5 et javascript

  7. #7
    R�dacteur/Mod�rateur

    Avatar de SpaceFrog
    Homme Profil pro
    D�veloppeur Web Php Mysql Html Javascript CSS Apache - Int�grateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 659
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 75
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activit� : D�veloppeur Web Php Mysql Html Javascript CSS Apache - Int�grateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 659
    Billets dans le blog
    1
    Par d�faut
    Quel est le rapport entre une calculatrice et un mot de passe ?
    Ma page Developpez - Mon Blog Developpez
    Pr�sident du CCMPTP (Comit� Contre le Mot "Probl�me" dans les Titres de Posts)
    Deux r�gles du succ�s: 1) Ne communiquez jamais � quelqu'un tout votre savoir...
    Votre post est r�solu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de D�veloppez !

  8. #8
    Membre r�gulier
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 26
    Localisation : Guin�e

    Informations professionnelles :
    Activit� : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Par d�faut
    Merci moi je suis nouveau ici je veux le code html pour realiser une calculatrice pour ma page web.

  9. #9
    R�dacteur/Mod�rateur

    Avatar de SpaceFrog
    Homme Profil pro
    D�veloppeur Web Php Mysql Html Javascript CSS Apache - Int�grateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 659
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 75
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activit� : D�veloppeur Web Php Mysql Html Javascript CSS Apache - Int�grateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 659
    Billets dans le blog
    1
    Ma page Developpez - Mon Blog Developpez
    Pr�sident du CCMPTP (Comit� Contre le Mot "Probl�me" dans les Titres de Posts)
    Deux r�gles du succ�s: 1) Ne communiquez jamais � quelqu'un tout votre savoir...
    Votre post est r�solu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de D�veloppez !

  10. #10
    Membre chevronn�
    Homme Profil pro
    Analyse syst�me
    Inscrit en
    Mai 2014
    Messages
    396
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Arm�nie

    Informations professionnelles :
    Activit� : Analyse syst�me
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Mai 2014
    Messages : 396

  11. #11
    Membre r�gulier
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 26
    Localisation : Guin�e

    Informations professionnelles :
    Activit� : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Par d�faut
    Bonjour Eleydet le lien que vous m'avez envoyer je vois pas les codes sources de ces buttons merci d'avoir m'aider pour faire de plus...

  12. #12
    Membre chevronn�
    Homme Profil pro
    Analyse syst�me
    Inscrit en
    Mai 2014
    Messages
    396
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Arm�nie

    Informations professionnelles :
    Activit� : Analyse syst�me
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Mai 2014
    Messages : 396
    Par d�faut
    Bonjour,

    La page �tant affich�e avec FireFox, appuyez simultan�ment sur les touches CTRL et U. Cela fait appara�tre le code de la page. Un simple copier-coller vous permet de l'ins�rer dans un �diteur de texte.

    Avec un autre navigateur, la proc�dure pour voir le code de la page peut �tre diff�rente.

  13. #13
    Membre tr�s actif
    Avatar de H2R file comme l'aire
    Homme Profil pro
    Pilote moto gp
    Inscrit en
    F�vrier 2017
    Messages
    70
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Corse (Corse)

    Informations professionnelles :
    Activit� : Pilote moto gp

    Informations forums :
    Inscription : F�vrier 2017
    Messages : 70
    Par d�faut
    Le code source est
    Code html : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
     
    <html><head>
        <meta charset="utf-8">
        <title>CALCULATRICE</title>
        <style>
        body {
            background-color: #ddd;
            text-align: center;
            padding-top: 20px;
            font-family: sans-serif;
        }
        noscript {
            display: block;
            position: fixed;
            top: 0px;
            right: 0px;
            left: 0px;
            bottom: 0px;
            text-align: center;
            padding-top: 60px;
            background: #ddd;
            color: #c32;
            font-size: 1.4em;
        }
        button {
            width: 57px;
            font-size: 19px;
            height: 35px;
        }
        .petit {
            font-size: 14px;
            height: 26px;
        }
        #fond {
            display: inline-block;
            background-color: #bbb;
            background-image : linear-gradient(75deg, #aaa, #bbb);
            color: #fff;
            font-size: 16px;
            padding: 12px;
            border-top: 1px solid #999;
            border-bottom: 6px solid #888;
            border-right: 3px solid #777;
            border-left: 1px solid #999;
            border-radius: 15px;
            box-shadow: 3px 6px 9px #999;
        }
        #ecran {
            background-color: #dec;
            background-image: linear-gradient(#efd,#deb);
            color: #675;
            font-size: 25px;
            text-align: right;
            margin: 4px;
            padding-left: 8px;
            padding-right: 8px;
            padding-top: 3px;
            padding-bottom: 3px;
            border-top: 4px solid #999;
            border-bottom: 4px solid #ccc;
            border-right: 4px solid #aaa;
            border-left: 4px solid #aaa;
            border-radius: 8px;
        }
        #angles {
            padding: 4px;
        }
        </style>
        <script>
        var courant="0"; // Nombre que l'utilisateur est en train d'entrer.
        var nb_ent=""; // Nombre entré, résultat d'une opération.
        var oper=""; // Nombre entré avec l'opération en cours.
        var coef="(Math.PI/180)"; // Coefficient pour convertir les angles.
        var nb_mem=""; // Nombre sauvegardé en mémoire en cliquant sur le bouton MS.
        function afficher(ch) { document.getElementById("ecran").innerHTML=ch; }
        function arrondir(ch) {
            ch=ch*1;
            ch=(ch.toPrecision(9))*1;
            if (ch>1e9) ch=ch.toExponential();
            return ch;
        }
        function sauv_mem() {
            if (courant!="") {
                nb_ent=courant;
                courant="";
            }
            nb_mem=nb_ent;
        }
        function rappel_mem() {
            if (nb_mem!="") {
                courant="";
                nb_ent=nb_mem;
                afficher(arrondir(nb_ent));
            }
        }
        function aj_pi() {
            courant="";
            nb_ent=Math.PI;
            afficher(arrondir(nb_ent));
        }
        function aj_ch(ch) {
            if (ch=="e") { if (nb_ent!="") courant=nb_ent; }
            else {
                if (courant=="0") courant=""; // Le 0 devant le nombre entré est enlevé...
                if (ch=="."&&courant=="") courant="0"; // sauf pour un nombre à virgule.
            }
            courant+=ch;
            nb_ent="";
            afficher(courant);
        }
        function chgt_signe() {
            if (nb_ent!="") {
                nb_ent=""+eval("\(-1\)*\("+nb_ent+"\)");
                afficher(arrondir(nb_ent));
            }
            else {
                var pos=courant.indexOf("e");
                if (pos==-1) courant=""+eval("\(-1\)*\("+courant+"\)");
                else {
                    if (courant.indexOf("e-")==-1) {
                        courant=courant.substring(0,pos+1)+"-"+courant.substring(pos+1,courant.length);
                    }
                    else courant=courant.substring(0,pos+1)+courant.substring(pos+2,courant.length);
                }
                afficher(courant);
            }
        }
        function aj_op(ch) {
            if (courant!="") {
                nb_ent=courant;
                courant="";
            }
            if (ch=="exposant") oper+="Math.pow("+nb_ent+",";
            else {
                if(oper.charAt(oper.length-1)==",") oper+=nb_ent+")";
                else oper+="("+nb_ent+")";
                if (ch=="+"||ch=="-") {
                    oper=""+eval(oper);
                    afficher(arrondir(oper));
                }
                oper+=ch;
            }
            nb_ent="";
        }
        function aj_ft(ch) {
            if (courant!="") {
                nb_ent=courant;
                courant="";
            }
            if (nb_ent=="") nb_ent="0";
            if (ch=="sin") nb_ent=""+eval("Math.sin\("+nb_ent+"*"+coef+"\)");
            if (ch=="cos") nb_ent=""+eval("Math.cos\("+nb_ent+"*"+coef+"\)");
            if (ch=="tan") nb_ent=""+eval("Math.tan\("+nb_ent+"*"+coef+"\)");
            if (ch=="ln") nb_ent=""+eval("Math.log\("+nb_ent+"\)");
            if (ch=="log") nb_ent=""+eval("Math.log\("+nb_ent+"\)/2.30258509299");
            if (ch=="asin") nb_ent=""+eval("Math.asin\("+nb_ent+"\)/"+coef);
            if (ch=="acos") nb_ent=""+eval("Math.acos\("+nb_ent+"\)/"+coef);
            if (ch=="atan") nb_ent=""+eval("Math.atan\("+nb_ent+"\)/"+coef);
            if (ch=="exp") nb_ent=""+eval("Math.exp\("+nb_ent+"\)");
            if (ch=="inverse") nb_ent=""+eval("1/\("+nb_ent+"\)");
            if (ch=="carre") nb_ent=""+eval("\("+nb_ent+"\)*\("+nb_ent+"\)");
            if (ch=="racine") nb_ent=""+eval("Math.sqrt\("+nb_ent+"\)");
            if (ch=="factorielle") {
                var nb=eval("parseInt\("+nb_ent+"\)");
                var result=1;
                if (nb>=0) { for (var i=1;i<=nb;i++) result=result*i; }
                else { for (var i=-1;i>=nb;i--) result=result*i; }
                nb_ent=""+result;
            }
            afficher(arrondir(nb_ent));
        }
        function evaluer() {
            if (courant!="") {
                nb_ent=courant;
                courant="";
            }
            if (oper.charAt(oper.length-1)==",") oper+=nb_ent+")";
            else oper+="("+nb_ent+")";
            nb_ent=""+eval(oper);
            oper="";
            afficher(arrondir(nb_ent));
        
        }
        function raz() {
            courant="0";
            nb_ent="";
            oper="";
            afficher("0");
        }
        </script>
        <style type="text/css">:root div[style="margin: 0 auto;width: 1000px;background-color:#fff;height:300px;\a   border-bottom: 4px solid #2d98e0"],
        :root [id^="lig_"],
        :root #banshopping1
        {display:none !important;}</style><style type="text/css">@keyframes fadeInOpacity{0%{opacity:0}to{opacity:1}}:hover>*>.fbvd--wrapper{animation-name:fadeInOpacity;animation-duration:.3s;opacity:1}.fbvd--wrapper{position:absolute;top:10px;left:10px;opacity:0;text-align:center;margin:0;z-index:5}.fbvd--wrapper a{background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzRiNGY1NiIgZD0iTTggMTUuNWw3LjUtNy41aC00LjV2LThoLTZ2OGgtNC41eiI+PC9wYXRoPjwvc3ZnPg==) no-repeat 3px 4.55px; background-color: #fff; display:inline-block;font:700 14px Helvetica,Arial,sans-serif;color:#4b4f56;text-decoration:none;vertical-align:middle;padding:0px 8px 0px;margin-right:8px;border-radius:2px; line-height: 22px; padding-left:19px; border: 1px solid #e7e7e7; background-size: 13px}.fbvd--wrapper a:last-child{margin-right:0}.fbvd--wrapper a:hover{text-decoration:none}.fbvd--wrapper a:focus{box-shadow:0 0 1px 2px rgba(88,144,255,.75),0 1px 1px rgba(0,0,0,.15);outline:none}.fbvd--wrapper b{font-size:13px;position:relative;top:1px;color:#3b5998;font-weight:400}</style></head>
     
        <body>
        <div id="fond">
        <div id="ecran">0</div>
        <div id="angles">
        <input type="radio" name="unit_ang" onclick="coef='(Math.PI/180)';" checked=""> deg
        &nbsp;&nbsp;<input type="radio" name="unit_ang" onclick="coef='1';"> rad
        &nbsp;&nbsp;<input type="radio" name="unit_ang" onclick="coef='(Math.PI/200)';"> gra
        </div>
        <table><tbody><tr>
        <td width="25%"><button type="button" class="petit" onclick="aj_ft('sin');">sin</button></td>
        <td width="25%"><button type="button" class="petit" onclick="aj_ft('cos');">cos</button></td>
        <td width="25%"><button type="button" class="petit" onclick="aj_ft('tan');">tan</button></td>
        <td><button type="button" class="petit" onclick="aj_ft('log');">log</button></td>
        </tr><tr>
        <td><button type="button" class="petit" onclick="aj_ft('asin');">asin</button></td>
        <td><button type="button" class="petit" onclick="aj_ft('acos');">acos</button></td>
        <td><button type="button" class="petit" onclick="aj_ft('atan');">atan</button></td>
        <td><button type="button" class="petit" onclick="aj_ft('ln');">ln</button></td>
        </tr><tr>
        <td><button type="button" class="petit" onclick="aj_ft('racine');"></button></td>
        <td><button type="button" class="petit" onclick="aj_ft('carre');">x<sup>2</sup></button></td>
        <td><button type="button" class="petit" onclick="aj_op('exposant');">x<sup>y</sup></button></td>
        <td><button type="button" class="petit" onclick="aj_ft('exp');">e<sup>x</sup></button></td>
        </tr><tr>
        <td><button type="button" class="petit" onclick="sauv_mem();">MS</button></td>
        <td><button type="button" class="petit" onclick="rappel_mem();">MR</button></td>
        <td><button type="button" class="petit" onclick="aj_ft('inverse');">1∕x</button></td>
        <td><button type="button" class="petit" onclick="aj_ft('factorielle');">x!</button></td>
        </tr><tr>
        <td><button type="button" onclick="aj_ch('7');">7</button></td>
        <td><button type="button" onclick="aj_ch('8');">8</button></td>
        <td><button type="button" onclick="aj_ch('9');">9</button></td>
        <td><button type="button" onclick="aj_op('/');">÷</button></td>
        </tr><tr>
        <td><button type="button" onclick="aj_ch('4');">4</button></td>
        <td><button type="button" onclick="aj_ch('5');">5</button></td>
        <td><button type="button" onclick="aj_ch('6');">6</button></td>
        <td><button type="button" onclick="aj_op('*');">×</button></td>
        </tr><tr>
        <td><button type="button" onclick="aj_ch('1');">1</button></td>
        <td><button type="button" onclick="aj_ch('2');">2</button></td>
        <td><button type="button" onclick="aj_ch('3');">3</button></td>
        <td><button type="button" onclick="aj_op('-');"></button></td>
        </tr><tr>
        <td><button type="button" onclick="aj_ch('0');">0</button></td>
        <td><button type="button" onclick="aj_ch('.');">.</button></td>
        <td><button type="button" onclick="chgt_signe();">±</button></td>
        <td><button type="button" onclick="aj_op('+');">+</button></td>
        </tr><tr>
        <td><button type="button" onclick="evaluer();">=</button></td>
        <td><button type="button" onclick="aj_pi();">π</button></td>
        <td><button type="button" onclick="aj_ch('e');" style="font-size: 17px;">.10<sup>x</sup></button></td>
        <td><button type="button" onclick="raz();">C</button></td>
        </tr></tbody></table>
        </div>
        <noscript>Pour utiliser cette calculatrice, activez l'option JavaScript de votre navigateur.</noscript>
        </body></html>
    et pr�cise aussi de vient le site de cette source

Discussions similaires

  1. Comment ex�cuter une DLL ?
    Par chleuh dans le forum Langage
    R�ponses: 4
    Dernier message: 29/06/2005, 14h27
  2. Comment ex�cuter un programme externe ?
    Par spikto dans le forum Langage
    R�ponses: 12
    Dernier message: 27/06/2005, 16h18
  3. R�ponses: 1
    Dernier message: 23/02/2005, 11h23
  4. R�ponses: 7
    Dernier message: 03/02/2005, 17h20
  5. [rmi] Comment ex�cuter rmic sous Jbuilder9
    Par ensi dans le forum JBuilder
    R�ponses: 4
    Dernier message: 27/03/2004, 09h09

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo