我是新的使用跨度。我试图打印出我从同一页面上的两次JavaScript脚本获取的信息。<span> html重复打印出来
我可以打印,我得到一次,但是当我确定要打印的信息第二次它不显示它
这一个工程
<div id="layer4" class="auto-style10" style="position: absolute; width: 300px; height: 427px; z-index: 2; left: 1020px; top: 90px">
<span class="auto-style8"><h4>Incident Details</h4><br />
</span>
<br />
<h6> Report ID : </h6> <span id="ReportID"></span> <br />
<h6> Description : </h6> <span id="Description"></span><br />
<h6> Category : </h6> <span id="Category"></span> <br/>
<h6> Date and Time : </h6> <span id="DateTime"></span> <br />
<h6> User Id/ Mobile Number : </h6> <span id="UserID"></span><br />
<br />
<span id="ReportID"></span>
<form method="post" action="http://www.al-qarra.com/police_new/map2/changelevel.php" >
<select name="SelectCat" style="position: absolute; width: 60px; z-index: 2;">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<input name="reportno" type="hidden" value="<?php echo $_SESSION['incidentid']; ?>">
<input name="ChangeCat" id="SelectCat" type="submit" value="Change Status" style="position: absolute; left: 100px; width: 110px; z-index: 2;"/>
</form>
</div>
但是,当我复制信息同一格到相同的页面但不同的位置它不显示信息
<div id="layer44" class="auto-style10" style="position: absolute; width: 300px; height: 427px; z-index: 2; left: 1020px; top: 300px">
<span class="auto-style8"><h4>Incident Details</h4><br />
</span>
<br />
<h6> Report ID : </h6> <span id="ReportID"></span> <br />
<h6> Description : </h6> <span id="Description"></span><br />
<h6> Category : </h6> <span id="Category"></span> <br/>
<h6> Date and Time : </h6> <span id="DateTime"></span> <br />
<h6> User Id/ Mobile Number : </h6> <span id="UserID"></span><br />
<br />
</div>
这是我的javascript的要求
</style>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
$("#ReportID").text(nreportid);
$("#Description").text(ndesc);
$("#Category").text(ncat);
}
</script>
我已更新我的问题,其中包括javascript – 2013-03-13 00:15:31
@MuzZaden而我编辑了我的答案 – 2013-03-13 00:22:15
所以你说我应该只是将每个元素的名称替换为别的东西,这将起作用 – 2013-03-13 00:32:07