카테고리 없음
jQuery Events(이벤트)
James Wetzel
2011. 8. 6. 16:22
728x90
반응형
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery Events Sample 1</title>
<script src="../Script/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("[name=clickInput]").focus(function () {
$("[name=resultInput]").width("300");
$("[name=resultInput]").val("클릭하세요에 포커스가 있습니다");
});
$("button").mouseover(function () {
$(this).css("border", "thin silver solid");
$(this).css("width", "200");
$(this).css("height", "30");
});
});
</script>
</head>
<body>
<input type="text" name="clickInput" value="클릭하세요" />
<input type="text" name="resultInput" />
<button>마우스를 올려보세요.</button>
</body>
</html>
Event Method | Description |
---|---|
$(document).ready(function) | Binds a function to the ready event of a document (when the document is finished loading) |
$(selector).click(function) | Triggers, or binds a function to the click event of selected elements |
$(selector).dblclick(function) | Triggers, or binds a function to the double click event of selected elements |
$(selector).focus(function) | Triggers, or binds a function to the focus event of selected elements |
$(selector).mouseover(function) | Triggers, or binds a function to the mouseover event of selected elements |
728x90
반응형