通过getAttribute获取了a标签数组元素节点,但是没办法把节点作为参数输入函数。
1 回答
qq_呆瓜_fkoIZ8
TA贡献12条经验 获得超5个赞
你是什么意思呢?
如下可是你想要的?
<div id="box" name="title">
这是一个段落
</div>
<script type="text/javascript">
var oBox=document.getElementById("box");
var oTitle=oBox.getAttribute("name");
getAttr(oTitle);
function getAttr(oTitle){
alert(oTitle);
}
</script>添加回答
举报
0/150
提交
取消
