3.자바스크립트삽입방법

Programming/Javascript | 2012. 12. 13. 23:10
Posted by 오요미

<body>

<!-- 3. on~ 속성에다 javascript명령을 직접삽입하는 방법 -->

<input type = "button" value="버튼" style = "background-color:Yellow; border:solid 1px red;"

onclick="window.alert('클릭');"onmouseover="this.style.backgroundColor='green';"/>

</body>


=> 버튼을 마우스로 클릭하면 alert창이 뜨고 버튼 위에 마우스를 갖다대면 버튼 색이 녹색으로 변한다.

(backgroundColor:대소문자주의)

 
블로그 이미지

오요미

공부할 수 있는 순간을 감사하며 공부하라.

카테고리

분류 전체보기 (121)
Electronics (1)
Programming (72)
Culturallife (30)
English (11)
취업 (1)
대학원 (4)
Life (1)