I have HTML page with several frames on it. One of frames(called Main) contains several INPUT’s.
When I use this:
Main.document.getElementsByTagName('input')
It works fine. But then I try do the same in jQuery:
$("input",Main)
$("input",Main.document)
$("input",window.Main)
$("input",window.Main.document)
All of them returns null. What am I doing wrong?
UPDATE
$(Main) returns null too.
UPDATE
jQuery is included inside of Main frame.
at base page I have that row:
<script>$=Main.$;</script>
jQuery cannot return
nullfor selectors. It’s very likely that you have included the wrong library, such as Mootools. You have to include jQuery at the main window. If$is overwritten, you can still usejQueryinstead of$to use jQuery methods.When you’ve made sure that you’ve included jQuery, use
frames.Mainorframes["main"], to have a readable code.Mainwill not point to the frame when you define a variable called Main.It’s recommended to not use the jQuery framework of the main when the frame also included jQuery, because some settings are different per window. Use: