开发者

jquery say input[name=state] is null but not null

开发者_如何学Pythoni am create modal and incude input modal .

<input type="hidden" name="state" id="state" value="123" />

but output $('#state').val() is null

$(document).ready(function()
{
    if ( $('#state').val() == '')
    {
    alert('null') // input is full but return null
    }
    else
    {
    alert('not null') // runing else 
    }
}


Doesn't behave like that to me.

However, try this:

$(document).ready(function(){
    if ( $('#state').val() == '')
    {
        alert('null'); // input is full but return null
    }
    else
    {
        alert('not null'); // runing else 
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜