Created
September 20, 2014 07:02
-
-
Save precious-ming/1f58772c636e777e7401 to your computer and use it in GitHub Desktop.
遍历(js、java)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<img src="http://img3.cache.netease.com/ent/2014/8/20/20140820195348e7e34.jpg" alt="成龙就房祖名吸毒道歉:我教子无方 很羞愧" width="310" height="220"> | |
</div> | |
<div> | |
<img src="http://img3.cache.netease.com/ent/2014/8/20/20140820195348e7e34.jpg" alt="hehe" width="310" height="220"> | |
</div> | |
<script src="http://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$("img").each(function(i){ | |
var img = $(this); | |
img.click(function(){ | |
alert(img.attr("alt")) | |
}) | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment