Caso 1: seleccione todo
Puntos de conocimiento de la aplicación: onDblClick = () | OnClick | Encuentre atributos de etiqueta, juicios y aplicaciones de funciones
<! DOCTYPE%20HTML> <HTML>%20%20 <Head>%20%20%20%20 <meta%20charset = "utf-8">%20%20%20%20 <title> </title> 20 20 %20 </head>%20%20 <cuerpo>%20%20%20%20 <div>%20%20%20%20%20%20%20%20 <input%20Type = "botón"%20Value = "Seleccione Todos "%20ondblClick =" checkall () "%20/ >%20%20%20%20%20%20%20 <entrada%20Type = "botón"%20Value = "Cancelar"%20ondblClick = "CANCLEALL ()"%20/>%20%20%20% 20%20%20%20%20 <entrada%20Type = "botón"%20Value = "Underelect"%20ondblClick = "Reverseall ()"%20/>%20%20%20%20%20 20 %20 <Thead> thead>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 20 %20%20%20%20 <tbody%20ID = "TB">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 0%20%20%20%20%20%20%20 </tr>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20 </tr>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20 </tr>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20 </tr>%20%20%20%20%20%20 </tbody>%20%20%20%20 </table>%20%20%20%20%20 <script>%20%20%20%20%20%20 // Si selecciona todo, primero obtenga todos los atributos de la etiqueta de entrada, y luego todos son verdaderos%20%20%20%20%20%20 20 20 función%20checkall () {%20%20%20%20%20%20%20%20VAR%20TB%20 =%20Document.getElementBy ID ('TB'); // Obtener TB, es decir, es, es decir, Cuerpo%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 (Var%20i = 0; i <cheques.length;%20i ++) 0%20%20%20%20%20%20%20%20%20%20) lealll () {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 // Primero [Primero, 2, 4, 5, 5] Choque de 20) %20%20%20%20%20%20%20%20%20 for%20(var%20i=0;i<checks.length;%20i++){%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20VAR%20TB%20 =%20 Documento. Cuerpo%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 CHECKS%20 =%20TB.GE. TelementsbyClassName ('C1');%20%20%20%20%20%20%20%20%20%20%20 // [Primero, 2, 3, 4, 5] controlado%20 =%20true%20%20%20%20%20%20%20%20%20%20 checks [i]; // Obtenga cada valor de INP UT y asigna un nombre variable de variable con nombre variable %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2 2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 </body> </ html>Caso 2: opción única
Solo puede elegir uno y usar JS para cambiar sus opciones
Puntos de conocimiento de la aplicación: GetElementsByTagName%20 |%20Cecked%20 |%20Mutex
<! DOCTYPE%20HTML> <HTML>%20%20 <Head>%20%20%20%20 <meta%20charset = "utf-8">%20%20%20%20 <title> </title>%20%20 </head>%20%20 <cuerpo>%20%20 20 %20%20 <ul>%20%20%20%20%20%20%20%20%20 <li> <input%20Type = "radio"%20name = "g"%20Value = "11"%20/> hombre </li>%20%20%20%20%20%20%20%20 <L i> <input%20Type = "radio"%20name = "g"%20Value = "22"%20/> mujer </li>%20%20%20%20%20%20%20%20 <!-Radio%20 =%20Document.getElementsByTagname UT%20Type = "Radio"%20Name = "G"%20Value = "11">,%20 <input%20Type = "Radio"%20Name = "G"%20Value = "11">,%20 <Input%20Type = "Rad Rad io "%20name =" g "%20Value =" 11 ">]%20%20%20%20%20radio [1]%20%20%20%20%20%20 <input%20Type =" radio "%20name =" g "%20Value =" 11 ">> %20%20%20%20XO%20 =%20radio [1]%20%20%20%20%20%20 <entrada%20Type = "radio"%20name = "g"%20Value = "11">%20%20%20%20%20%20%20XO 20XO 20XO . Valor%20%20%20%20%20%20XO. Verificado%20%20%20%20FALSE%20%20%20XO. CHECKED%20 =%20true%20%20%20true->%20%20 </fody> </html>
Caso 3: clonación
<! DOCTYPE%20HTML> <HTML>%20%20 <Head>%20%20%20%20 <meta%20Charset = "UTF-8">%20%20%20 <TITL E> </title>%20%20 </head>%20%20 <body>%20%20%20%20 <H2%20ID = "H1"> 333%20%20%20%20%20 <pan> 1 23 </span>%20%20%20%20%20%20%20%20%20 <pan> 123 </span>%20%20%20%20%20%20%20%20%20%20%20 <pan> 123 </span>%20%20%20%20%20%20%20%20%20%20%20%20%20 </53 </span>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 <panjado </amplio>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 <pane 0%20%20%20 <a> 123 </a>%20%20%20%20 </H2>%20%20%20%20%20%20 <div%20id = "contenedor">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20 </div>%20%20%20%20%20 <script>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20/C.C./C.C./C./C./C.C.C.Eppenicet. agregado a 2 //%20%20%20%20%20%20VAR%20NEWH%20 =%20H.CLONENODE (verdadero); // no es verdadero, solo formato de clonación //%20%20%20 C.AppendChild (Newh); Después de agregar verdadero, está completamente clonado a 2%20%20%20%20 </script>%20%20 </body> </ html>
Caso 4: atributos personalizados, obtener atributos personalizados y cambiar el contenido de la etiqueta
<! DocType%20html> <html>%20%20 <Head>%20%20%20%20 <meta%20charset = "utf-8">%20%20%20%20%20 <title> </title>%20%20 </bead>%20%20 <cuerpo>%20%20%20%20%20%20%20 /// a selector puede estar construido construido %20%20%20%20%20 //%20%20%20%20%20 <entrada%20Type = "botón"%20onclick = "func ()"%20Value = "Haga clic me "%20/>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20 20 <div%20class = "c1"%20alex = 'sb'> 123 </div>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 <diviv%20C lass = "C1"> 123 </div>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%<Div%20Class = "C1"%20alex = 'SB'> 123 </div>%20 20 %20%20%20%20%20 <Div%20Class = "C1"> 123 </div>%20%20%20%20 </div>%20%20%20%20%20 <script>%20%20%20%20 Función%20Func () {%20%20%20%20%20%20 ///1 ALL COMBILLO, COOP ALIGHTA CADA CADENA CIEN 0i1%20 =%20Documento. GetElementByid ('i1')%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 para%20 (%20Var%20i%20 = 0;%20i <divs.length; i ++) {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2 2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 curry rent_div%20 =%20Divs [i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20 (R R ESULT%20 ==%20'SB ') {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20}%20%20%20%</script>%20%<Cuerpo </cotilCaso 5: Tres formas de obtener los valores en el cuadro de entrada
<! DocType%20html> <html> <fead>%20%20 <title> </title>%20%20 <meta%20charset = "utf-8"%20/> </head> <body>%20%20 <div%20ID = "inp">%20%20%20%20%</div>%20 </iv>%20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 %20<input%20type="text"%20class="aa"/>%20%20<input%20type="button"%20value="add"%20onclick="Func();"%20/>%20%20</div>%20%20<div%20id="lis">%20%20%20%20 %20 <ul>%20%20%20%20%20%20%20 <li> Cerdo estofado </li>%20%20%20%20%20%20 <li> Codo estofado </li>%20%20%20%20%20%20 <Li> Pescado estofado </li>%20%20%20 </ul>%20%20%</div> 20%20%20 <Script> 20%2%2 0%20%20VAR%20Inp_AA%20 =%20Document.getElementsByClassName ('aa');%20%20%20%20inp_aa [0] .value%20 =%20'Braised Bagre '; // equivalente a ingresar el contenido%20%20 en la caja de entrada </script> </body> </hml> <! DocType%20html> <html> <Head>%20%20 <title> </title>%20%20 <meta%20Charset = "utf-8"%20/> </feod> <body>%20%20 <Div%20ID = "INP">%20%20%20%20 </div>%20%20 <Input 20Type = "Text" Text "Text" Text "Text" ss = "aa"/>%20%20 <input%20Type = "Button"%20Value = "add"%20onClick = "func ();"%20/>%20%20 </div>%20%20 <div%20ID = "lis">%20%20%20 <divs%20id = "lis">%20%20%20%20ID = "lis" %20%20 <ul>%20%20%20%20%20%20%20%20 <li> Cerdo estofado </li>%20%20%20%20%20%20 <li> Codo estofado </li>%20%20%20%20 </div> 20%20%20%20VAR%20C%20 =%20Document.QuerySelector ('. AA'); // Selector de consultas%20. es la identificación de distinción, la sintaxis de la etiqueta%20%20%20c.value%20 =%20' berenjena en casoMétodo 2: consulta
<! DOCTYPE%20HTML> <html> <Head>%20%20 <title> </ticle>%20%20 <meta%20CharSet = "utf-8"%20/> </head> <body>%20%20 <Div%20id = "INP">%20%20%20 </div >%20%20 <input%20Type = "text"%20id = "aa"/>%20%20 <input%20Type = "botón"%20Value = "agregar"%20onclick = "func ();"%20/>%20%20 </div>%20%20 <divs%20ID = "li 20ID =" li 20ID S ">%20%20%20%20 <ul>%20%20%20%20%20%20%20 <li> Cerdo estofado </li>%20%20%20%20%20%20 <li> Ase Codo </li>%20%20%20%20%20 </ul>%20%20 </div>%20%20%20 <script>%20%20%20%20Var%20c%20 =%20Document Berenjena ';%20%20%20%20%20 </script> </body> </html>
Método 3: ID
Caso 6:
%20 // 'antes de Begin', 'Afterbegin'/%20'BeForeforend '/' AfterENd '
<! Doctype%20html> <html>%20%20 <Head>%20%20%20%20 <title> </title>%20%20%20%20 <meta%20charset = "utf-8"%20/>%20%20 </head>%20%20%20 <cuerpo>%20%20%20 <Di Di V%20ID = "INP">%20%20%20%20 </div>%20%20%20%20%20 <input%20Type = "Text"%20/>%20%20%20%20%20 <input%20Type = "botón"%20Value = "Agregar"%20onclick = "Addelen (esto)" " %20/>%20%20%20%20</div>%20%20%20%20%20%20<div>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20<li>Braised Pork</li>%20%20%20%20%20%20%20<li>Braised Elbow< /li>%20%20%20%20%20%20%20%20%20%20 <li> pescado estofado </li>%20%20%20%20%20%20 </ul>%20%20%20%20 </div>%20%20%20%20%20%20%20%20 Función 20 20 20 20 addelen (ths)%20 {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20VAR%20AAA%20 =%20. Errt (AAA)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 t_li)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20list_li.insertadjacenthtml ("Borforend",%20Bbb)%20%20%20%20%20%20%20}%20%20%20%20 </script>%20%20 </fody> </html> <! DocType%20html> <html>%20%20 <Head>%20%20%20%20 <title> </title>%20%20%20%20 <meta%20charset = "utf-8"%20/>%20%20 </head>%20%20%20 <cuerpo>%20%20 20 20 %20%20%<div%20ID = "INP">%20%20%20%20 </div>%20%20%20%20%20%20 <entrada%20Type = "text"%20/>%20%20%20%20%20 <input%20Type = "botón"%20Value = "Agregar"%20on haga clic = "Addelen (esto)"%20/>%20%20%20%20 </div>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 20 t>%20%20%20%20%20%20%20%20 Función%20addelen (THS) {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Document_LI%20 =%20Document. UL%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 TAGE%20 =%20Documento T. Creeelement li%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20list_li.insertBefore(tag,%20list_li.children[-1])//Insert the value of the required position according to the index %20%20%20%20}%20%20%20 </script>%20%20 </body> </ html><! DOCTYPE%20HTML> <HTML>%20%20 <Head>%20%20%20%20 <meta%20charset = "utf-8">%20%20%20%20 <title> </title>%20%20 </head>%20% 20 <Cuerpo>%20%20%20%20 <Div>%20%20%20%20%20%20%20%20%20 <input%20Type = "Texto"%20/>%20%20%20%20%20%20%20%20 <Input%20Type = "pero" tonelada "%20Value =" agregar "%20onclick =" adicional (this) "%20/>%20%20%20%20%20 </div>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 </ul>%20%20%20%20 </div>%20%20%20%20%20%20 <Script>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 20 %20 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20) %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%antes de. huevo, 'Afterbegin'/%20'BorforEnd '/' After -end '%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%Afterb Afterb Close ajuste%20%20%20%20%20%20%20%20%20 // After Edent%20 Close-ajuste externo //%20 %20%20%20%20%20%20%20%20%20 CommentList. 20%20%20%20%20%20%20%20%20TAG. 20val;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 etiqueta
Caso 7:
<! DOCTYPE%20HTML> <HTML>%20%20 <Head>%20%20%20%20 <meta%20charset = "utf-8">%20%20%20%20%2 2 2 0Height:%2040px;%2040px;%2040px;%2040px;%2040px;%2040px;%20%20%20%20%20Height:%2040px;%2 0%20%20%20%20%20}%20%20%20%20%20%20%.gg{%20%20%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% %20%20 </estilo>%20%20 </head>%20%20 <body>%20%20%20%20%20%20%20%20 <p> Cuando el mouse ingresa sí, elimine el contenido </p>%20%20%20%20 <p> Cuando la tabla de entrada sale, agregue el contenido </p>%20%20%20%20 <input%20Type = "Text"%20Class = "GG"%20Val. contenido "%20onfocu s =" foco (this) "%20onblur =" blur (this) "%20/>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 // La primera forma de encontrar%20%20%20%20%20%20%20 // documento. . %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20IF%20 (actual_val%20 ==%20 "Por favor ingrese contenido ") {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20 FUNTION%20BRUR (THS)%20 {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20IF%20 (Current_Val%20 ==%20 "Ingrese el contenido"%20 ||%20Current_Val. %20%20%20%20%20%20%20%20%20%20%20%20.Caso 8: Menú principal
<! DOCTYPE%20HTML> <HTML>%20%20 <Head>%20%20%20%20 <title> </title>%20%20%20%20%20 <meta%20charset = "ut" ut F-8 "%20/>%20%20%20%20%20%20%20%20%20.PG_TOP%20.Menu%20 {%20%20%20%20%20%20%20%20%20% r:%20 Gold;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 Font-Size:% 2025px;%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 0%20%20%20%20%20%20%20%20 Background-Color:%20 Burlywood;%20%20%20%20%20%20%20%20%20%20%20%20%20%20. CUADRO%20 {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%Hide 20 {{20%20%20%20%20%20%20%20%20%20%20%20%20%20%. 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 </estilo>%20%20%20%20 20 </cabeza>%20%20 <cuerpo>%20%20%20%20%20 <div%20Class = "PG_TOP">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 %20%20 <div%20class = "item"%20con = "h2"%20onclick = "show (this)"> Guijie </div>%20%20%20%20%20%20%20%20%20 2 2 2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%<D iv%20id = "contenido"%20class = "contenido">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 ° 20CLASS = "HIED" OBITACIÓN ACTIVE OBITACIÓN DEL COMBIENTA AT. barra </div>%20%20%20%20%20%20 </div>%20%20%20%20 </div>%20%20%20%20%20%20 <script>%20%20%20%20%20 función%20show (ths)%20 {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2 2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 0BABA%20 =%20T. 0%20%20%20%20%20%20%20%20%20%20%20 Si%20 (ths%20 ==%20baba [i])%20 {%20 // Haz un juicio, %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20BABA [i] .classList.remove ('bk')%20 // eliminar atributos%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 // Contenido%20%20%20%20%20%20%20%20%20%20%20%20%20 VAR%20Con ElementByid ('contenido'). Niños;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 para%20 (J = 0;%20J <Control_Con.length; j ++)%20 {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 Var 20s 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20S Var 20s 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 Var 20s 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 Var. rent_con [j] .getAttribute ('con')%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%. 20} de lo contrario {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%</script>%) < %%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 0;%20%20%20%20}%20%20%20%20ul%20li {%20%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20 20 20 20 Color:%20 White;%20%20%20%20%20%20%20%20%20%20%20%Pading:%208px%2010px;%20%20%20%20%20}%20%20%20%20%20. CLEARFIX: después de {2 2 2% 0%20%20%20%20%20 Discirpla:%20Block;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 0%20%20%20. CUADRO {%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20.TAB-MENU%20.TITLE {%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.Tab-Menu%20.TITA%20.ACTIVO {%20%20%20%20%20%20 22 2 0%20%20 Background-Color:%20 White;%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20 Border:%201PX%20SOLID%20#DDDDDD;%20%20%20%20%20min altura:%20150px;%20%20%20%20%20}%20 20 %20 </estilo>%20%20 </head>%20%20 <body>%20%20%20%20 <Div%20Style = "Ancho: 400px;%20margin:%200%20au a; ">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 >%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 0Target = 'H3'%20onClick = "Show (this)"> TiAnshahai </li>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%<divs 20con = "h1"> horneado Piernas de cordero </div>%20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20 </div>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 <cript>%20%20%20%20%20%20 Función%20Show (THS) Etiqueta%20%20%20%20%20%20%20%20VAR%20Target%20 =%20ths.getAttribute ('objetivo') // H3%20%20%20%20%20%20%20%20 // Estilo de su cuenta usted mismo activo%20%20%20%20%20%20%20%20%20%20%20%20. %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 VAR%20 Broters%20 =%20. para (var%20i = 0; i <br otros. 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 2 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20). %%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 CONSOLO. tiendas)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 var%20con%20 =%20Current_content.getTattribute ('Con')%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)Caso 9: Volver a la cima
Puntos de conocimiento principal: Onscroll%20 y document.body.scrolltop;
<! Doctype%20html> <html>%20%20 <Head>%20%20%20%20 <meta%20charset = "utf-8">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.go-top {%20%20%20%20%20% 20%20%20%20 Posposición:%20fijo;%20%20%20%20%20%20%20%20 Posposición:%20fijo;%20%20%20%20%20%20 Posposición:%20fijo;%20%20%20%20%20%20 Posposición:%20fijo; %20%20%20%20%20%20%20%20) 0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 0%20%20%20%20%20%20%20 Derecho:%2020px;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 Coror de interior: Coror: Coror de fondo: Coror de fondo: Coror de fondo: Coror de fondo: Coror de fondo: Coror de intervención: Coror de intervención: Coror: KgoldenRod;%20%20%20%20%20%20%20%20%20 Color:%20 White;%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20 <B Ody%20onscroll = "func ();">%20%20%20%20%20 <div%20id = "i1"%20Style = "Altura:%202000px;%20 background-color:%20g Reenyellow; ">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 </div>%20%2%2 0%20%20<div%20id="i2"%20class="go-top%20hide">%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% 20%20 Función%20Func () {%20%20%20%20%20%20%20%20%20%20%20 VAR%20SCROLLTOP%20 =%20Document.Body.ScollTop; // Altura de desplazamiento del cuerpo%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% %20IF (scrolltop> 100) {%20%20%20%20%20%20%20%20%20%20%20II.ClassList.remove ('escondite'); // retirarlo para mostrar %20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 20 %20}%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20}%20%20%20%20 </script>%20%20 </body> </ html>Caso 10:
Puntos principales de conocimiento:
// desplazamiento%20 desplazamiento; El significado del desplazamiento
//%20ScrollTop:%20 Altura de barra de desplazamiento desde la parte superior
//%20ScrollHeight:%20 Altura del documento: en sí mismo + Padre
//%20ClientTop:%20 Altura del borde
//%20ClientHeight:%20 El rango actual altura visible: en sí mismo%20+%20 Padding
// Compensación%20 Significado de impresión
//%20OffSettop:%20 La altura de la etiqueta actual desde "Top" (cuerpo)
//%20 Si no hay publicación en su nivel anterior, si lo hay, la etiqueta de posición se basa principalmente en la etiqueta de posición.
//%20OffSetTheight:%20 La altura de su propio rango: en sí mismo + relleno + borde
<! Doctype html> <html> <fead> <meta charset = "utf-8"> <title> </title> </head> <body> <div style = "altura: 20px; background-color: verde;"> </div> <!-head-> <div style = "borde: 5px rosa sólido; padding: 10px;"> <!-body-<div> <div> estilo = "altura: 200px; desbordamiento: auto; ancho: 400px; margen: 0 auto; borde: 15px sólido rojo; relleno: 3px;" > <Viv> SDF </div> <iv> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> <1> sdf </div> <div> sdf </div> <div> sdf </iv> <Viv> SDF </div> <iv> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> <1> sdf </div> <div> sdf </div> <div> sdf </iv> <Viv> SDF </div> <iv> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> <1> sdf </div> <div> sdf </div> <div> sdf </iv> <Viv> SDF </div> <iv> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> <1> sdf </div> <div> sdf </div> <div> sdf </iv> <Div> SDF </div> <iv> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <iv> sdf </div> <div> sdf </div> <Div> SDF </div> <iv> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <div> sdf </div> <iv> sdf </div> <div> sdf </div> <div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div><div>sdf</div> <div>sdf</div> <div>sdf</div> </div> </div> </div> </div> </div> <script> var ii = document.getElementById('xo') console.log(ii.scrollTop) console.log(ii.scrollHeight) console.log(ii.clientTop) console.log(ii.clientHeight) console.log(ii.offsetTop) console.log(ii.offsetHeight) //scroll Scroll; scroll meaning // scrollTop: scrollbar height from the top // scrollHeight: Document height: itself + padding// clientTop: border height // clientHeight: visible range height: itself + padding //offset Print meaning // offsetTop: The current label distance from the "top" (body)// If there is no post on the previous level, if there is one, the position label is mainly used // offsetHeight: The visible range height: itself + padding+border </script> </body></html>好了,暂时就介绍到这里希望大家多写多练,主要是其中的逻辑,当然现在很多人都开始使用jquery了,大家也多注意。