我想從文本框ASP.NET控件中獲取日期字符串,但沒有成功。 我的代碼是:javascript不能從文本框中獲取字符串
function countdown() {
now = new Date();
var biddate = $("#InitiateDate1").val();
kickoff = Date.parse(biddate);
diff = kickoff - now;...
我想從文本框ASP.NET控件中獲取日期字符串,但沒有成功。 我的代碼是:javascript不能從文本框中獲取字符串
function countdown() {
now = new Date();
var biddate = $("#InitiateDate1").val();
kickoff = Date.parse(biddate);
diff = kickoff - now;...
它$('<%=InitiateDate1.ClientID%>').val();
只是嘗試
function countdown() {
now = new Date();
var biddate = document.getElementById('<%=InitiateDate1.ClientID%>').value
kickoff = Date.parse(biddate);
你能夠顯示HTML爲您的文本? – DevelopmentIsMyPassion 2013-03-17 08:32:34
看看你的HTML源代碼..我敢打賭,文本框的ID不是InitiateDate1。因爲你通過調用.val() – 2013-03-17 22:34:06