Jquey调试代码

来源:互联网 发布:大数据涂子沛主要观点 编辑:程序博客网 时间:2024/06/05 03:14
<!doctype html><html><head><script src="2.2.1/jquery.js"></script></head><body><div id="firstDiv"><p>first p</p><input type="text" id="firstDivText" value="firstDivText" /><div id="firstDivFirstChild"><p>firstDivFirstChild p</p>    <input type="text" id="firstDivFirstChildText" value="firstDivFirstChildText" /></div><p>second p</p></div><textarea rows="3" cols="40" id="firstTextArea" placeholder="输入文本。。"></textarea><div id="secondDiv">id="secondDiv"</div><input type="checkbox" id="secondDivCheck1" name="secondDivCheck" value="1" /><input type="checkbox" id="secondDivCheck2" name="secondDivCheck" value="1" /><input type="checkbox" id="secondDivCheck3" name="secondDivCheck" value="1" /><input type="checkbox" id="secondDivCheck4" name="secondDivCheck" value="1" />  <div id="thirdDiv">    <input type="text" id="thirdDivText" value="thirdDivText" />  </div>  <div id="fourDiv">    <input type="button" id="fourDivButton" value="测试" onClick="testJquery()"/>  </div></body><script>function testJquery(){//$("p").html('id="notMe5"');//alert($("input").val());//var elementSelected = $("input[type='checkbox']");var elementSelected = $(":checkbox:even");//alert(elementSelected instanceof Array );alert("length:"+elementSelected.length);//alert("html:"+elementSelected.html());//alert("val:"+elementSelected.val());//elementSelected.val(function(i,orignText){//return this.disabled+"|test|"+orignText;//}//);elementSelected.prop("checked",true);}</script></html>

0 0
原创粉丝点击