jquery事件

Original 2019-05-17 13:10:44 213
abstract:<!DOCTYPE html> <html> <head> <title>jquery事件</title> <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script> <st

<!DOCTYPE html>

<html>

<head>

<title>jquery事件</title>

<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>

<style type="text/css">

div{width:100px;height:100px;background:red;}


</style>

</head>

<body>


<div></div>

<img src="1.png">

<button>click</button>


<button id="toggle">toggle</button>

<script type="text/javascript">

$(function(){

$('button').click(function(){

$('div').css('background','blue');

})

$('div').hover(

function(){


$(this).css('background','pink');

}

function(){

$(this).css('background','green');

}

)

$('#toggle').click(function(){

$('img').toggle();


})

})


</script>

</body>

</html>


Correcting teacher:天蓬老师Correction time:2019-05-17 17:50:59
Teacher's summary:你的作业, 是不是没有写完, 事件就这么点?

Release Notes

Popular Entries