오락기/js

inline event

문방구앞오락기 2017. 4. 18. 14:29

<input type="button" id="target" onclick="alert('Hello world, '+document.getElementById('target').value);" value="button" />


<input type="button" onclick="alert('Hello world, '+this.value);" value="button" />


이벤트를 그대로 삽입