<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>第二次上机</title>
<style>
div{
font-size: large;
}
</style>
<script src="js/vue.js"></script>
</head>
<body>
<div id="d">
CSS是一种描述HTML的文档样式语言,CSS描述应如何显示HTML元素。<br>本教程将从零点的基础教程开始,一直到CSS3高级教程,为你提供全面系统讲解。
</div>
<input type="button" value="加背景" id="s1" onclick="f1()">
<input type="button" value="字体变大" id="s2" onclick="f2()">
</body>
<script>
window.onload=function(){
var div=document.getElementById("d");
f1=function(){
d.style.backgroundColor="blue";
}
f2=function(){
d.style.fontSize="larger";
}
}
</script>
</html>
原状态:
按按钮后的状态: