如何使用jQuery查找/检测页面中的任何文本区域? [英] How to find/detect any textarea in page using jQuery?

查看:69
本文介绍了如何使用jQuery查找/检测页面中的任何文本区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的页面中放入一个名为enableTinyMCE()的函数调用;在该函数中,我想查看页面中是否有任何文本区域,如果是,那么是否还需要tinyMCE.init()函数.如何检测页面中是否有任何textarea元素?

I want to put a function call in my pages called enableTinyMCE(); In that function I want to see if there are any textarea's in my page and if so do the tinyMCE.init() function. How do I detect if there are any textarea elements in the page?

推荐答案

if( $('textarea').length > 0 ) {
    ...
}

这篇关于如何使用jQuery查找/检测页面中的任何文本区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆