开发者

How can i find whether it is a text box or text area using jQuery?

How can I find whether an element is a text b开发者_如何学编程ox or text area using jQuery?

For example i am having two radio button:

While i clicking the first one it should display text box.

While i clicking the second one it should display text area.

But nearby text box label should be displayed "TEXTBOX" using jquery.

And nearby textarea label should be displayed "TEXAREA" using jquery.

How can this be done?


$('#text').is("textarea")
$('#text').is("input")


document.getElementById(controlId).type will give you the type of the dom Element.

Example

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜