jquery选择iframe儿童 [英] jquery select iframe children

查看:109
本文介绍了jquery选择iframe儿童的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用editArea库和jquery来做我需要的...

I am using the editArea library and jquery to do what i need...

http://www.cdolivet.com/index.php?page=editArea&sess=2b8243f679e0d472397bfa959e1d3841

所以在我的html中有一个iframe标签,editArea使用我需要的东西来使用jquery访问类似的东西

so in my html there is an iframe tag that editArea uses what i need is to access something like so with jquery

$('iframe textarea').keydown(function (e){
   number = 17; //any number really :)
    if(e.which == number){
        //do something...
        alert('Done...');
    }
});

我尝试了上述内容,但看起来它没有检测到该密钥。但是如果选择器是$(document)
,那么它的作用是因为它的其余功能正常运行它只是它没有拿起iframes textarea keydown

I tried the above but it looks like it is not detecting that key. but it works if selector was $(document) therefore the rest of the function works it's just it's not picking up the iframes textarea keydown

任何想法?
谢谢

any ideas? Thanks

推荐答案

$("iframe").contents().find("textarea").keydown(...)

这篇关于jquery选择iframe儿童的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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