본문 바로가기

개발하자/jQuery

원하는 버튼에 이벤트주기

<html>
 <head>
 <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
 <script>

 $(document).ready(function(){

 $($("input")[0]).click(function(){ alert("aaa"); });

 });

 </script>
 </head>
 <body>
 <input type="button" >
<input type="button" >
<input type="button" >
 </body>
</html>

'개발하자 > jQuery' 카테고리의 다른 글

원하는 태그의 css값 얻어오기  (0) 2015.02.27
원하는 태그에 css적용시키기  (0) 2015.02.27
클릭한 버튼 원하는 값으로 바꾸기  (0) 2015.02.27
모드 버튼에 이벤트 주기  (0) 2015.02.27
blur  (0) 2015.02.23