我想在
中显示hiddentfield值
<p style="color: Red">
Please note that you have <span>
javascript:$("input[id$=hdnCartCount]").val();
</span> more pending orders.
<br />
Click Checkout to proceed!
</p>
我该如何显示?
答案 0 :(得分:4)
假设您希望这是动态的,请稍微重新排列您的HTML(记下我给您的跨度的ID):
<p style="color: Red">
Please note that you have
<span id="pendingOrdersCount"></span>
more pending orders.
<br />
Click Checkout to proceed!
</p>
然后你可以这样做:
<script type="text/javascript">
$(function () {
$("#pendingOrdersCount").text($("input[id$=hdnCartCount]").val());
});
</script>
答案 1 :(得分:0)
尝试向提供 ID 和
$("#spanId").text($('#hdnField').val());