Bouton
bolo
-
Utilisateur anonyme -
Utilisateur anonyme -
Salut,
c mon premier script en javascript un truc simple
<script language="javascript">
<!--
b = prompt("tape le texte!!", 'le texte');
c= prompt("Puis le lien maintenant",' http://');
//-->
</script>
j'aimerai que lorsque je clique sur un bouton le script démarre comment je peux réaliser
ca merci
c mon premier script en javascript un truc simple
<script language="javascript">
<!--
b = prompt("tape le texte!!", 'le texte');
c= prompt("Puis le lien maintenant",' http://');
//-->
</script>
j'aimerai que lorsque je clique sur un bouton le script démarre comment je peux réaliser
ca merci
A voir également:
- Bouton
- Diagnostic bouton photo - Accueil - Outils
- Bouton reinitialisation pc - Guide
- Bouton shift pc - Forum Jeux vidéo
- Réinitialiser chromecast sans bouton - Guide
- Bouton couleur telecommande - Guide
2 réponses
Renseigne-toi sur l'évenement OnClick de Javascript. Tu peux trouver des cours d'initiatoin à Javascript sur ce même site :
http://www.commentcamarche.net/jscript/evenemen.php3
Tabou Junior
http://www.commentcamarche.net/jscript/evenemen.php3
Tabou Junior
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
<!--
//En déclarant ici tes variables, elles seront globales, donc visibles par
//toutes tes fonctions
var a;
var b;
var message;
function getTextAndLink(){
b = prompt("tape le texte!!", 'le texte');
c= prompt("Puis le lien maintenant",' http://');
message = "Vous avez tapé le texte <b>\"" + b + "\"</b><br /> et le lien <b>\""+c+"\"</b>";
}
function showInput(){
win = window.open('','','toolbars: no; scrollbars: no');
win.document.write(message);
}
//-->
</script>
</head>
<body>
<button type="button" onClick="getTextAndLink();showInput();">Clique ici</button>
</body>
</html>
;-)
HackTrack
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
<!--
//En déclarant ici tes variables, elles seront globales, donc visibles par
//toutes tes fonctions
var a;
var b;
var message;
function getTextAndLink(){
b = prompt("tape le texte!!", 'le texte');
c= prompt("Puis le lien maintenant",' http://');
message = "Vous avez tapé le texte <b>\"" + b + "\"</b><br /> et le lien <b>\""+c+"\"</b>";
}
function showInput(){
win = window.open('','','toolbars: no; scrollbars: no');
win.document.write(message);
}
//-->
</script>
</head>
<body>
<button type="button" onClick="getTextAndLink();showInput();">Clique ici</button>
</body>
</html>
;-)
HackTrack