开发者

Generically select a textarea

开发者 https://www.devze.com 2023-03-01 23:27 出处:网络
I am looking for a way to select a textarea from some element 开发者_StackOverflowon the page via a jQuery selector but can\'t seem to figure it out.

I am looking for a way to select a textarea from some element 开发者_StackOverflowon the page via a jQuery selector but can't seem to figure it out.

Here is an example what I have tried:

JsFiddle

I would like to use the :input[type='blah'] but 'textarea' doesn't seem to be the correct syntax. Or possible create my own selector but Im not sure how to select just the textarea in the first place.


A <textarea> is not an <input type="textarea">.

What's wrong with $('textarea')? (example)

Edit It's unfortunate that, while $(':input') will confusingly include textareas, there is no variant to select just textareas through it. I see now why you were confused. As above, just look for textarea elements directly.

0

精彩评论

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