返回 通过各种方法获...... 登陆

通过各种方法获取元素作业。

古桑 2019-03-25 14:28:47 201

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>Document</title>

<style>

li{list-style: none;}

ul{font-size:20px;}

a{text-decoration: none; }

</style>

</head>

<body>

<div class="top1">

<ul id='ul1' >

<li class="li1" >我们是共产主义接班人</li>

<li  >我是西藏人</li>

<li >我是中国人</li>

<li>我爱我的祖国</li>

</ul>

</div>

<div class="top2">

<img src="../zuoye/11.jpg" name="pic">

<form acction='' name='biao'>

<input type='text' name='text' placeholder="用户名输入">

<input type="password" name="pwd" class="pwd" placeholder="八位密码">

<button>提交</button>

<br>

</form>

<a href="" name='php' id="php">我是一个链接标签</a>

</div>

</body>

</html>

<script>

document.getElementById('ul1').style.backgroundColor="pink";

document.getElementsByTagName('li')[1].style.backgroundColor="#ff6500";

document.getElementsByTagName('li').item(3).style.color="#ff6500";


document.images[0].style.border="5px solid #000";

document.images['pic'].style.boxShadow="0 0 50px #333";

document.images.pic.style.height="200px";


document.getElementsByName('biao').style.backgroundColor="#ff6500";


document.getElementsByName('php').style.backgroundColor="#ff6500";

document.getElementById('php').style.color="#000";


document.links[0].style.fontSize="40px";



</script>


最新手记推荐

• 用composer安装thinkphp框架的步骤 • 省市区接口说明 • 用thinkphp,后台新增栏目 • 管理员添加编辑删除 • 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消 回复 发送
  • PHP中文网