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
精彩评论