JQuery .bind()

1 개요[ | ]

jQuery bind 함수

2 예시 1[ | ]

<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$(function() {
	$('#button1').bind('click', button_clicked);
	$('#button2').click(button2_clicked);
});

function button_clicked() {
	$('body').append('<br>버튼1 클릭됨');
}



<button id='button1'>버튼1</button>
<button id='button2'>버튼2</button>

3 예시 2: 여러 이벤트 bind[ | ]

<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$(function(){
	$('#textarea1').bind({
		change: textarea1_access,
		click: textarea1_access,
		keydown: textarea1_access,
		blur: textarea1_access,
	});
});
function textarea1_access(event) {
	$('body').append("<br>"+event.type);
}
</script>

<textarea id='textarea1'></textarea>

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}