Blogger Information
Blog 8
fans 0
comment 1
visits 4964
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
fxq20171219
追梦者的博客
Original
581 people have browsed it
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div>
<h3>“无聊”聊天室</h3>
<ul>
<li>美女:你好啊!</li>
<li>帅哥:你也好!</li>
<li>美女:在干什么?</li>
<li>帅哥:没事做啊,你在干啥?</li>
</ul>
<button>querySelector</button>
  <input type="button" name="" value="jquery"/>
</div>
</body>
<script type="text/javascript">
var btn=document.querySelector('button');
btn.onclick=function(){
var li=document.querySelectorAll('.boy');
var li1=document.querySelectorAll('.girl');
var ul=document.querySelector('ul')
ul.style.width='200px';
ul.style.listStyle='none';
        for(i=0;i<li.length;i++){
         li[i].style.backgroundColor='yellow';
          }
          for(i=0;i<li1.length;i++){
         li1[i].style.backgroundColor='red';
          }
}

$('input').on('click',function(){
$('div').css('background','skyblue').css('width','300px');
})   

</script>
</html>


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post