开发者

jQuery .valid() throws error

In my JavaScript function sometimes $(args._postBackElement).valid() throws error because it is not a valid input element. Is there any way to check whether .valid() can be called for开发者_StackOverflow社区 that element?


You could do -

$(args._postBackElement).length 

to see if the element existed, or -

$(args._postBackElement).is(":input")

to see if it's an input element.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜