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
    Futur Membre du Club
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 25
    Localisation : Guinée

    Informations professionnelles :
    Activité : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Points : 5
    Points
    5
    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
    Expert confirmé
    Avatar de Doksuri
    Profil pro
    Développeur Web
    Inscrit en
    Juin 2006
    Messages
    2 451
    Détails du profil
    Informations personnelles :
    Âge : 54
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Juin 2006
    Messages : 2 451
    Points : 4 600
    Points
    4 600
    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 confirmé
    Homme Profil pro
    Analyse système
    Inscrit en
    Mai 2014
    Messages
    388
    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 : 388
    Points : 578
    Points
    578
    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
    Futur Membre du Club
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 25
    Localisation : Guinée

    Informations professionnelles :
    Activité : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Points : 5
    Points
    5
    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
    16 957
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 957
    Points : 44 121
    Points
    44 121
    Par défaut
    Bonjour,
    j'ai du mal à comprendre ce que tu veux réellement faire !!???!!

  6. #6
    Futur Membre du Club
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 25
    Localisation : Guinée

    Informations professionnelles :
    Activité : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Points : 5
    Points
    5
    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 637
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    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 637
    Points : 66 656
    Points
    66 656
    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
    Futur Membre du Club
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 25
    Localisation : Guinée

    Informations professionnelles :
    Activité : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Points : 5
    Points
    5
    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 637
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    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 637
    Points : 66 656
    Points
    66 656
    Billets dans le blog
    1
    Par défaut
    Une petite recherche sur le forum s'impose ...
    https://www.developpez.net/forums/d1...ce-javascript/
    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 confirmé
    Homme Profil pro
    Analyse système
    Inscrit en
    Mai 2014
    Messages
    388
    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 : 388
    Points : 578
    Points
    578

  11. #11
    Futur Membre du Club
    Homme Profil pro
    Bien man
    Inscrit en
    Septembre 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 25
    Localisation : Guinée

    Informations professionnelles :
    Activité : Bien man

    Informations forums :
    Inscription : Septembre 2017
    Messages : 9
    Points : 5
    Points
    5
    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 confirmé
    Homme Profil pro
    Analyse système
    Inscrit en
    Mai 2014
    Messages
    388
    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 : 388
    Points : 578
    Points
    578
    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 habitué
    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
    Points : 173
    Points
    173
    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