First the two page in under the same domain
In the parent page.htm I have only a element like input#test,
input#test
then I set a iframe in the parent page
Try
var input = $(window.self.top).contents().find('input#test');
or
var input = $(window.self.top.document).find('input#test');