开发者

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

开发者 https://www.devze.com 2023-04-03 18:03 出处:网络
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:

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

精彩评论

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