52. Montrer tous les liens
Ajoutez le code suivant à la zone <body>
| <script linguisse = "javascript1.2"> <! - fonction extractLinks () { var links = document.all.tags ("a") var total = links.length var win2 = window.open ("", "", "MenUbar, barre de défilement, barre d'outils") win2. *** ("<font size = '2'> Il y a un total de" + total + "Connexions </font> <br>") pour (i = 0; i <total; i ++) { win2. *** ("<font size = '2'>" + liens [i] .outerhtml + "</font> <br>") } } // -> </cript> <input type = "bouton" onclick = "extractLinks ()" value = "affiche toutes les connexions"> |
53. Entrez la clé pour changer la ligne
Ajoutez le code suivant à la zone <body>
| <script type = "text / javascript"> Fonction Handleenter (champ, événement) { var keycode = event.keycode? event.which: event.Charcode; if (keycode == 13) { var i; for (i = 0; i <field.form.elements.length; i ++) if (field == field.form.elements [i]) casser; i = (i + 1)% field.form.elements.length; field.form.Elements [i] .focus (); retourne false; } autre Retour Vrai; } </cript> <formulaire <input type = "text" onKeyPress = "return handleenter (this, event)"> <br> <input type = "text" onKeyPress = "return handleenter (this, event)"> <br> <TextArea> Entrez le chariot et la ligne |
54. Soumettre après confirmation
Ajoutez le code suivant à la zone <body>
| <Script linguisse = "javascript"> <! - fonction msg () { si (confirmez ("vous êtes sûr de vouloir vous soumettre!")) document.lnman.submit () } // -> </cript> <form name = "lnman" méthode = "post" action = ""> <p> <input type = "text" name = "textfield" value = "soumettre après confirmation"> </p> <p> <input type = "bouton" name = "soumi" value = "soumi" onclick = "msg ();"> </p> </ form> |
55. Changez le contenu de la table
Ajoutez le code suivant à la zone <body>
| <script *** script> var arr = new Array () arr [0] = "一一一一"; arr [1] = "22222"; arr [2] = "33333"; </cript> <select onchange = "zz.cells [this.selectedIndex] .InnerHtml = arr [this.selectedIndex]"> <Valeur d'option = A> Modifiez la première trame </opoption> <Valeur d'option = A> Modifiez la deuxième trame </opoption> <Valeur d'option = A> Modifiez la troisième image </opoption> </lect> <Table ID = ZZ Border = 1> <tr height = 20> <td width = 150> Premier cadre </td> <td width = 150> deuxième carré </td> <td width = 150> troisième cadre </td> </tr> </ table> |