亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

jQuery ?? ???

???? ???? ???? ?? ??? ????? ?? ??? ??? ?? ?????. ?? ???? jQuery? ??? ???? ?? ??? ?? ??? ?? ?? ?? ???????.

?? ???? ?? ???? ?? ??:

333.png


??:

?? ?? ?? ????? ?? ?? ?? ???? ??? ?? ??? ?? ?? ?????. ???? ?? ???? ??? ?? ??? ??? ? ????. ?? ?? $(':password') == $('[type=password]')

??? ?? ?? ?? ????? ?? ??? ??? ????.

$("#form1  :input").length;        //注意與$("#form1   input")的區(qū)別

??? ?? ??? ? ? ??? ?? ?? ???? ??? ??? ????.

$("#form1   :text").length;

??? ???? ?? ?? ???? ?? ??? ??? ????.

$("#form1   :password").length;

????? ?? ?? ???? ??? ?????

???? ?? <p> ??? ???? ??? <p> ??? onclick ???? ?????. ?:

$("p").click(function({
            //doing somethingr(操作)
})

ID? tb? ??? ?????. ?? ?? ? ???? tbody ??? ?? ?? tbody ???? ??? ?? ??? tr ??? ?? ???? ?????(css(" property","value"); jQuery ??? ???? ???? ? ???). ?:

$('#tb tbody tr:even').css("BackgroundColor","#888");

?? ??? ?? ??? ?? ?? ?? ??? ???? ????? ????? ??? ?????. ?? ?? jQuery ??? ??:

$('#btn').click(function(){
                  var   length=$("input[name='check']:checked").length;
                  alert("選中的個數(shù)為:"+length);
})

?? ?? ??="text" ??? ?? ?? ???: $("input:text").val("");


???? ??
||
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title></title> <style> input{ display: block; margin: 10px; padding:10px; } </style> <script src="http://code.jquery.com/jquery-3.1.1.min.js"></script> <style> input{ display: block; margin: 10px; padding:10px; } </style> </head> <body> <h2>子元素篩選選擇器</h2> <h3>input、text、password、radio、checkbox</h3> <h3>submit、image、reset、button、file</h3> <div class="left first-div"> <form> <input type="text" value="text類型"/> <input type="password" value="password"/> <input type="radio"/> <input type="checkbox"/> <input type="submit" /> <input type="image" /> <input type="reset" /> <input type="button" value="Button" /> <input type="file" /> </form> </div> <script type="text/javascript"> //查找所有 input, textarea, select 和 button 元素 //:input 選擇器基本上選擇所有表單控件 $(':input').css("border", "1px groove red"); </script> <script type="text/javascript"> //匹配所有input元素中類型為text的input元素 $('input:text').css("background", "#A2CD5A"); </script> <script type="text/javascript"> //匹配所有input元素中類型為password的input元素 $('input:password').css("background", "yellow"); </script> <script type="text/javascript"> //匹配所有input元素中的單選按鈕,并選中 $('input:radio').attr('checked','true'); </script> <script type="text/javascript"> //匹配所有input元素中的復選按鈕,并選中 $('input:checkbox').attr('checked','true'); </script> <script type="text/javascript"> //匹配所有input元素中的提交的按鈕,修改背景顏色 $('input:submit').css("background", "#C6E2FF"); </script> <script type="text/javascript"> //匹配所有input元素中的圖像類型的元素,修改背景顏色 $('input:image').css("background", "#F4A460"); </script> <script type="text/javascript"> //匹配所有input元素中類型為按鈕的元素 $('input:button').css("background", "red"); </script> <script type="text/javascript"> //匹配所有input元素中類型為file的元素 $('input:file').css("background", "#CD1076"); </script> </body> </html>