본문 바로가기

개발하자/자바스크립트

html onclick 이벤트

<html>
 <head>
 <style type="text/css">
 </style>
 <script>
  function a(){
   b1.value="홍길동"
  }
  function b(){
   b2.value="구민정"
  }
 </script>
 </head>
 <body>
 <input type="button" value="aa" id="b1" onclick=a()>
 <input type="button" value="bb" id="b2" onclick=b()>
 </body>
</html>

'개발하자 > 자바스크립트' 카테고리의 다른 글

배열사용  (0) 2015.02.07
주석  (0) 2015.02.07
1~100까지 10X10칸만들기(5의 배수표시)  (0) 2015.02.05
버튼색변경  (0) 2015.02.05
rowspan,colspan  (0) 2015.02.05