jquery基础语法

Original 2019-05-19 20:55:00 188
abstract:<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>jquery基础语法</title> <script type="text/javascript" src="jquery-3.3.1.mi

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>jquery基础语法</title>

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

<style type="text/css">

div{width:200px;height:200px;border:1px solid red;}

</style>

</head>

<body>

<div></div>

<button class="hide">隐藏</button><button class="show">显示</button><button class="BgColor">换色</button>

<script>

$(document).ready(function(){

$mStr="jquery的字符串变量";

console.log($mStr);

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

$('div').hide();

})

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

$('div').show();

})

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

$('div').css('background-color','red');

})



})

</script>


</body>

</html>


Correcting teacher:查无此人Correction time:2019-05-20 09:24:13
Teacher's summary:完成的不错。jq比js简单很多,多练习,jq可以代替js操作。继续加油。

Release Notes

Popular Entries