导入jquery报错
来源:2-8 自由编程
慕桂英8538108
2019-04-12 14:43:32
这个bug找了很久还是不知道哪里出错麻烦老师帮忙看下
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>职员列表</title>
<style>
div {
float: left;
border: 1px gray solid;
width: 200px;
text-align: center;
}
</style>
</head>
<body>
<div id="s1">员工列表</div>
<div class="s2">职位列表</div>
<div class="s3">部门列表</div>
<script type = "text/javascript" src = "js/jquery-3.3.1.js"></script>
<script type="text/javascript">
document.getElementById("s1").onclick = function(){
$(this).css("border-color","blue");
$(this).css("font-size","50px");
alert("diaomouren");
};
alert("diaomouren");
</script>
</body>
</html>
1回答
同学你好!在你的项目结构中并没有看到js文件夹,这样js文件并没有引入,可以在项目结构中添加js文件夹,将js放在文件夹下,如图所示:
如果我的回答解决了你的疑问,请采纳~祝学习愉快!
相似问题