contenido de la operación jQuery

<! DOCTYPE html > 
< html > 
    < head > 
        < meta charset = "utf-8" > 
        < title > </ title > 
    </ head > 
    < body > 
        < div id = "d1" > 
            < p >哈哈</ p > 
        < / div > 
        < input id = "input1" type = "text" value = "嘎嘎"  />
        type = "button" value = "点击"  /> 
        < script type = "text / javascript" src = "../ images / jquery-3.4.1.min.js" > </ script > 
        < script type = "text / javascript " > 
            var dj = document.getElementById ( " dj " );
            dj.onclick =  function () {
                 / * document.getElementById ("d1"). innerHTML * / 
                / * Los parámetros html se utilizan para modificar el valor * / 
                / * var html = $ ("# d1"). html ( "谷 谷 谷 谷 谷 谷"); // <p> jaja </ p> * / 
                var html = $ ( " # d1 " ) .html (); // <p> jaja </ p> 
                alerta ( " html: " + html);
                 / * document.getElementById (" d1 "). innerText * / 
                var text = $ ( "# d1 " ) .text ();//                 alerta jaja 
( " texto: " + texto);
                 / * document.getElementById ("d1"). Valor * / 
                var val = $ ( " # d1 " ) .val (); //                 alerta vacía 
( " val: " + val);
                 / * css (propiedades): establece un objeto" nombre: valor "para todas las propiedades de estilo de elementos coincidentes * / 
                $ ( " # d1 " ) .css ({ancho: " 100px " , altura: " 100px ",color:" rojo " });
                 / * El nombre del atributo contiene-, las comillas deben usarse * / 
                $ ( " # d1 " ) .css ({ " margin-top " : " 200px " });
                
            }
        </ script > 
    </ body > 
</ html >

 

Supongo que te gusta

Origin www.cnblogs.com/qilin20/p/12669362.html
Recomendado
Clasificación