热门标签 | HotTags
当前位置:  开发笔记 > 前端 > 正文

onclick事件触发不了,点击之后没反应,求大神解答

<!DOCTYPEhtml><htmlen><
DOCTYPE html >
< html lang= "en" >
< head >
< meta charset= "UTF-8" >
< meta name= "viewport" content= " >
< meta http-equiv= "X-UA-Compatible" content= "ie=edge" >
< title >Document title >
< style >
#table{
width: 450px;
height: 35px;
border: 1px solid blue;
margin: 0px auto;
background-color: bisque;
}
td{
width: 120px;
color: red;
}
.text{
margin: 0px;
margin-left: 20px;
float: left;
text-align: center;
line-height: 35px;
}
td span{
margin-left: 30px;
width: 60px;
text-align: center;
color: blue;
}
style >
< script >
function mouseover( tab){
//var tab=document.getElementById("text1");
tab. style. color= "blue";
tab. style. cursor= "pointer";
}
function mouseout( tab){
// var tab=document.getElementById("text1");
tab. style. color= "red";
}
function click( tab){
//var td=document.getElementsById("text1");
//td.style.color="green";
tab. style. fontWeight= "bolder";
tab. style. backgroundColor= "yellow";
}
script >
head >
< body >
< table id= "table" >
< tr >
< td onmouseover= "mouseover(this)" onmouseout= "mouseout(this)" onclick= "click(this)" >
< p class= "text" >Google p >
td >
< td >
< span >| span >
td >
< td onmouseover= "mouseover(this)" onmouseout= "mouseout(this)" onclick= "click(this)" >
< p class= "text" >Apple p >
td >
< td >
< span >| span >
td >
< td onmouseover= "mouseover(this)" onmouseout= "mouseout(this)" onclick= "click(this)" >
< p class= "text" >Microsoft p >
td >
tr >
table >
body >
html >

推荐阅读
author-avatar
pS看云梦山水Tn
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有