如何将html的数据传到同一界面的javascript
1个回答
展开全部
<div id="div_id_1"></div>
<table>
<tr><td><input type="button" id="table_id_1"></td></tr>
</table>
<div id="d2">
<input type="button" id="d2" onclick="thisfun('div_id_1', 'table_id_1');" />
</div>
<script>
function thisfun(a, b) {
alert(document.getElementById(a));
alert(document.getElementById(b));
}
</script>
<table>
<tr><td><input type="button" id="table_id_1"></td></tr>
</table>
<div id="d2">
<input type="button" id="d2" onclick="thisfun('div_id_1', 'table_id_1');" />
</div>
<script>
function thisfun(a, b) {
alert(document.getElementById(a));
alert(document.getElementById(b));
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询