标签:
http://www.cnblogs.com/kissdodog/archive/2012/11/20/2779964.html
/** * Created by Administrator on 2015/4/4 0004. */ /*$(function(){ $(‘input‘).click(function(){ alert(‘jqcode‘) }) })*/ /*$(function(){ alert(1); }) $(function(){ alert(2) })*/ $(function(){ alert($(‘#div1‘).get(0));//返回对象 $(‘#div1‘).css(‘color‘,‘red‘);//设置一些cssattr alert(document.getElementById($(‘#div1‘).css(‘color‘,‘blue‘)))//jq和dom之间的互换 }); /*方法1:*当如果一个HTML文件中出现多个jq库(可能是第三方,也可能是内置的)解决方法如下(jq库在其他库之前,$的所有权就是其他库) var $$=jQuery; $(fuction(){ alert(obj) alert($$(obj))}) */ /* 如果jq库在其他库之后,$的所有权就是jq库 */ /*解决方案 jQuery.noConflict() 移出自己的所有权的$*/
"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>带翻页效果公告栏</title> <link href="ok.css" type="text/css" rel="stylesheet"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script language="JavaScript" src="jquery-2.1.3.js" ></script> <script src="js1.js"></script> </head> <body > <!--<input type="button" value="测试">--> <div id="div1">测试</div> </body> </html>
标签:
原文地址:http://www.cnblogs.com/mhxy13867806343/p/4392582.html