静语培训第十六天

第十六天,开始感受JS的乐趣

学习时长:若干小时

2018年8月23日   晴

天变得很凉快了,适合学习。

直接上代码:

小练习代码;

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>IFE ECMAScript</title>
</head>
<body>
<input id="first-number" type="number" value="0" placeholder="第一个数字">
<input id="second-number" type="number" value="0" placeholder="第二个数字">
<button id="add-btn">加</button>
<button id="minus-btn">减</button>
<button id="times-btn">乘</button>
<button id="divide-btn">除</button>
<p id="result">运算结果</p>
 
<script>
window.onload = function(){
var arr = document.getElementsByTagName('button');
var getid;
for(var i = 0;i<arr.length;i++)
{
arr[i].onclick = function()
{
var x = parseInt(document.getElementById("first-number").value),
y = parseInt(document.getElementById("second-number").value);
getid = this.id;
switch(getid)
{
case "add-btn":result.innerHTML = x + y;break;
case "minus-btn":result.innerHTML = x - y;break;
case "times-btn":result.innerHTML = x * y;break;
case "divide-btn":result.innerHTML = x / y;break;
}
}
}
}
</script>
</body>
</html>
 简历代码:
<html>
<head>
<meta charset="UTF-8">
<title>张旭的个人简历</title>

</head>
 
<style>
h1 {
text-indent:50px;
color:white;
height: px;
width: max;
background: rgb(72, 72, 78);
float: top;
font-size: 40px;
font-weight:900;
padding-top: 3%;
padding-bottom: 3%;
margin:0%;
font-family:Microsoft YaHei;
}
h2 {
font-size:20px;
text-align:center;
background:rgb(147, 147, 151);
margin:0;
border-width:1px;
border-style:none none solid none;
border-color:white;
height:110px;
line-height: 110px;
width:120px;
clear: both;
float:left;
font-weight:900;
padding-top: 1%;
padding-bottom: 1%;
font-family:Microsoft YaHei;
}
p{
border-width:1px;
border-style:none none solid none;
border-color:rgb(147, 147, 151);
height:110px;
font-weight:900;
padding-left:10%;
padding-top: 1%;
padding-bottom: 1%;
 
margin: 0%;
font-family:Microsoft YaHei;
}
</style>

<body>
<div class="footer">
<a href="#" id="dowloadRe">下载简历</a>&Iota;
<a href="https://github.com/infrontofme">GitHub</a>&Iota;
<a href="https://blog.csdn.net/weixin_39611130">CSDN</a>
</div>
<button id="和你打招呼">和你打招呼</button>
<button id="点开看看我的特殊爱好">点开看看我的特殊爱好</button>
<h1>简历</h1>
<h2>基本信息</h2>
<p>姓名:张旭&ensp; &ensp; 性别:男&ensp; &ensp;&ensp; 应聘职位:web前端工程师</p>
<h2>联系方式</h2>
<p>手机:17854278528&ensp; &ensp; email:<b><a href="http://1312096632@qq.com/" target="_blank">1312096632@qq.com</a></b> &ensp; &ensp; 个人主页:<b><a href="http://www.cnblogs.com/Bitch-Zhang/" target="_blank">贱人张的博客园</a></b></p>
<h2>能力描述</h2>
<p>技术能力:熟练掌握HTML,CSS,JS<br>综合能力:良好的沟通,主动积极,努力勤奋</p>
<h2>教育经历</h2>
<p>本科<br>静语前端技术学院</p>
<h2>项目经历</h2>
<p>无</p>
</body>



<script>
document.getElementById("dowloadRe").onclick = function(){
document.getElementById("dowloadRe").href = "005-16_caidan.html";
window.location.href="005-16_caidan.html";
}
document.getElementById("和你打招呼").onclick = function(){
alert('你好呀');
}
document.getElementById("点开看看我的特殊爱好").onclick = function(){
alert('我喜欢你');
}
</script>





</html>

转载于:https://www.cnblogs.com/Bitch-Zhang/p/9523270.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值