这是javascript代码
<script type="text/javascript">
function divHDVisible(){
var div = document.getElementById('linkHD');
div.style.visibility = 'visible';
}
</script>
这是jsp代码
<font size="-2">
<a href="#" onclick="divHDVisible()"><%=dataJobs.getID_Harware_Use()%></a>
</font>
<div class="row" id="linkHD" style="visibility: hidden;">Success</div>
我想要的是在div中得到<%=dataJobs.getID_Harware_Use()%>
的值(div id = linkHD)
任何人都可以帮助我吗?
答案 0 :(得分:0)
试试这个:
function divHDVisible(elem) {
var div = document.getElementById('linkHD');
div.style.visibility = 'visible';
div.innerHTML = elem.innerHTML;
}
<font size="-2"><a href="#" onclick="divHDVisible(this)"><%=dataJobs.getID_Harware_Use()%></a></font>
<div class="row" id="linkHD" style="visibility: hidden;">Success</div>