jQuery
jQuery In Action chapter 4-1
우혁이 아빠
2009. 12. 20. 08:49
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery 이벤트 예제</title>
<script type="text/javascript" src="../js/jquery-1.2.1.js" ></script>
<script type="text/javascript">
$(function () {
$('#vstar')
.bind('click', function (event) {
say('첫 번째 우와!');
})
.bind('click', function (event) {
say('두 번째 우와!');
})
.bind('click', function (event) {
say('세 번째 우와!');
});
});
function say (text) {
$('#console').append('<div>' + text + '</div>');
}
</script>
</head>
<body>
<img id="vstar" src="vstar.jpg" />
<div id="console"></div>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery 이벤트 예제</title>
<script type="text/javascript" src="../js/jquery-1.2.1.js" ></script>
<script type="text/javascript">
$(function () {
$('#vstar')
.bind('click', function (event) {
say('첫 번째 우와!');
})
.bind('click', function (event) {
say('두 번째 우와!');
})
.bind('click', function (event) {
say('세 번째 우와!');
});
});
function say (text) {
$('#console').append('<div>' + text + '</div>');
}
</script>
</head>
<body>
<img id="vstar" src="vstar.jpg" />
<div id="console"></div>
</body>
</html>