html文字点击效果怎么弄?这里哪里有问题?
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content...
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function(){
function A(){alert("被点击了")}
}
</script>
</head>
<body>
<a href="#" onclick=A()>A</a>
</body>
</html> 展开
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function(){
function A(){alert("被点击了")}
}
</script>
</head>
<body>
<a href="#" onclick=A()>A</a>
</body>
</html> 展开
2015-06-15 · 百度知道合伙人官方认证企业
关注
展开全部
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function A(){
alert("被点击了")
}
</script>
</head>
<body>
<a href="#" onclick=A()>Addfdsfd</a>
</body>
</html>
这样就可以了
把window.onload=function(){}去掉就有效果了
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function A(){
alert("被点击了")
}
</script>
</head>
<body>
<a href="#" onclick=A()>Addfdsfd</a>
</body>
</html>
这样就可以了
把window.onload=function(){}去掉就有效果了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询