jQuery-制作黑白反斗棋页面
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title>无标题文档</title><scriptsrc="jquery-1.8.0.js"></script><script>$(function(){vart=$("<table>").appendTo("div");t.attr("border","1");for(vari=0;i<5;i++){varrow=$("<tr>").appendTo(t);for(varj=0;j<5;j++){varcols=$("<td>").appendTo(row);cols.attr({height:"100",width:"100",bgColor:"black"});cols.attr("id",i+"-"+j);cols.click(function(){alert(this.id);});}}});</script></head><body><div></div></body></html>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。