我是新的使用跨度。我試圖打印出我從同一頁面上的兩次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