javascript无法从文本框中获取字符串

时间:2013-03-17 07:38:19

标签: javascript asp.net user-controls

我正在尝试从Textbox ASP.NET控件获取日期字符串,但没有成功。 我的代码是:

function countdown() {
    now = new Date();
    var biddate = $("#InitiateDate1").val();
    kickoff = Date.parse(biddate);
    diff = kickoff - now;...

2 个答案:

答案 0 :(得分:0)

它是$('<%=InitiateDate1.ClientID%>').val();

答案 1 :(得分:0)

试试

function countdown() {
    now = new Date();
    var biddate = document.getElementById('<%=InitiateDate1.ClientID%>').value
    kickoff = Date.parse(biddate);