幫我看看代碼哪里出問題了
<!DOCTYPE?html> <html> <head> ????<meta?http-equiv="Content-type"?content="text/html;?charset=utf-8"?/> ????<title></title> ????<link?rel="stylesheet"?href="imooc.css"?type="text/css"> ????<script?src="http://www.xianlaiwan.cn/static/lib/jquery/1.9.1/jquery.js"></script> </head> <body> ????<h2>特殊選擇器this</h2> ????<p?id="test1">點擊測試:通過原生DOM處理</p> ???? ????<p?id="test2">點擊測試:通過原生jQuery處理</p> ????<script?type="text/javascript"> ????????var?p1?=?document.getElementById('test1'); ???????? ????????p1.addEventListener('click',function(){ ????????????this.style.color?=?"red";? ????????},false); ????</script> ????<script?type="text/javascript"> ???? ????????$('#test2').click(function(){ ????????????$(this).css('color','blue'); ????????}); ????</script> </body> </html>
顏色沒有改變?????
2018-07-11
我把你的代碼復制過去,有變啊,你點沒有。。。