div控制css样式

Original 2019-02-23 10:41:34 250
abstract:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><script src="../js/jq.js" ></script><style>.but{width: 300px;height:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<script src="../js/jq.js" >

</script>

<style>

.but{

width: 300px;

height: 300px;

background-color: aquamarine;

}

</style>


<script>

$(".item").click(function(){

$("but").css("display","none")

})

</script>

<title>Document</title>


</head>

<body>

<div class="but">

~hello~

</div>

<button class="item">点我隐藏</buttom>

<button id="em">点我有惊喜</buttom>

<button class="xyz">点我显示</buttom>

</body>

</html>



Correcting teacher:韦小宝Correction time:2019-02-23 10:44:03
Teacher's summary:使用jQuery来控制div的样式要比js简单的多了 代码也比js要少的多

Release Notes

Popular Entries