console.log($(this).title="这是第"+(index+1)+"个"+$(this).id);语法错误?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!--jQuery-1.7.2.min版本 官网引用地址如下:-->
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript"src="../js/jquery-2.0.0.min.js"></script>
<script>
$(function()
{
$("img").each(function(index){
console.log($(this).title="这是第"+(index+1)+"个"+$(this).id);
alert(index);
});
})
</script>
</head>
<body>
<img src="../image11/beauty-1.jpg" id="01">
<img src="../image11/beauty-2.jpg" id="02">
<img src="../image11/beauty-3.jpg" id="03">
<img src="../image11/beauty-4.jpg" id="04">
<img src="../image11/beauty-5.jpg" id="05">
</body>
</html>