<a id="a" name="a">abcdefg</a>
我想获取标签a中的内容:abcdefg 。请问有什么办法。我用下面的方法试过。得到的是:null
<%
String data = request.getParameter("a");
out.println("获取a标签的内容:"+data);
%>
JSP HTML
------解决方案--------------------
javascript是干嘛的啊
------解决方案--------------------
document.getElementById("a").getValue()
------解决方案--------------------
document.getElementById("a").innerHTML
------解决方案--------------------
document.getElementById("asdf").innerHTML;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<a id="asdf" name="a">abcdefg</a>
</body>
<script>
var ad = document.getElementById("asdf").innerHTML;
alert(ad);
</script>
</html>