访问元素 属性操作 案例2 <script> S(function <style> s(img") attr( title,"这是一张风景画"; IsIng SCimg").addClass(clsing); border: 2px solid #ccc; padding: 3px; float S(img).attr(src", function(t left: return"Images/mgo"+ Math. floor(Math. random(*2+1)+".jpg /style <body> </script> <img alt=" src="Images/img03 jpg width="400"height=300 </boar>访问元素 属性操作 案例2 <style> .clsImg{ border: 2px solid #ccc;padding: 3px; float: left;} </style> <body> <img alt="" src="Images/img03.jpg" width="400" height="300"> </body> <script> $(function(){ $("img").attr("title","这是一张风景画"); $("img").addClass("clsImg"); $("img").attr("src",function(){ return "Images/img0"+ Math.floor(Math.random()*2+1)+".jpg"; }); }); </script>