日期:2014-05-16  浏览次数:20325 次

javascript获取节点的value,浏览器不兼容
http://topic.csdn.net/u/20120803/10/279307ca-6ea5-4fb0-b453-8098d9a400e3.html?74388
好像这里的人多一点

------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>

<script type="text/javascript">

function fun(id){
var e = document.getElementById(id);
var v = e.getAttribute("value");
alert(v);
}
</script>
</head>
<body>

<div onClick="fun(this.id)" id="id" style="border:green; width:100px;height=50px; clear:both;" value="click here">click here</div>
</body>
</html>
你发在这里不一样吗? 哈