Skip to content

Instantly share code, notes, and snippets.

@gitgitWi
Created February 25, 2020 05:25
Show Gist options
  • Save gitgitWi/6a235b79b153189b3c261066a808d750 to your computer and use it in GitHub Desktop.
Save gitgitWi/6a235b79b153189b3c261066a808d750 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
<!--
$(function() {
$('#btnClick').bind("click", function() {
alert('클릭됨');
});
$('#btnClick').bind("mouseover", function() {
document.getElementById('btnClick').style.backgroundColor = 'red';
});
$('#btnClick').bind("mouseout", function() {
$('#btnClick').get(0).style.backgroundColor = 'blue';
});
});
-->
function fn1() {alert('클릭됨');}
function fn2() {document.getElementById('btnClick').style.backgroundColor = 'red';}
function fn3() {$('#btnClick').get(0).style.backgroundColor = 'blue';}
$(document).ready(
function() {
$('#btnClick').bind("click", fnc1);
$('#btnClick').bind("mouseover", fnc2);
$('#btnClick').bind("mouseout", fnc3);
}
)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment