问题:1.
我在<input id="Hidden1" type="hidden" value="我是在ASCX中的HIDDEN的值" runat="server"/>在javascript中怎么才能取到值了?
2.我作了个测试:<input id="Hidden1" type="hidden" value="我是在ASCX中的HIDDEN的值" onclick="return c();"/>在javascript能取到值。
方法:function c()
{
var readValue = document.getElementById("Hidden1").value;
alert(readValue);
}
我在<input id="Hidden1" type="hidden" value="我是在ASCX中的HIDDEN的值" runat="server"/>在javascript中怎么才能取到值了?
2.我作了个测试:<input id="Hidden1" type="hidden" value="我是在ASCX中的HIDDEN的值" onclick="return c();"/>在javascript能取到值。
方法:function c()
{
var readValue = document.getElementById("Hidden1").value;
alert(readValue);
}
}
<asp:Button ID="Button1"
runat="server" Text="Button" onclientclick="c();" />
<script type="text/javascript">
function c()
{
var readValue = document.getElementById("Hidden1").value;
alert(readValue);
}
</script>