开发者

jQuery .contentWindow.document.getElementById('email_box').value help

开发者 https://www.devze.com 2023-01-06 23:49 出处:网络
Hey all, i\'m just wondering if there was any way to condense this line of code to pure jQuery without having the need to have \".contentWindow.document.getElementById(\'email_box\').value\" in there?

Hey all, i'm just wondering if there was any way to condense this line of code to pure jQuery without having the need to have ".contentWindow.document.getElementById('email_box').value" in there?

 $('#OIPHPFrame')[0].contentWindow.document.getElementById('email_box').value = $("#txtEmail").val();

and also the "click" event:

 $('#OIPHPFrame')[0].contentWindow.document开发者_运维问答.getElementById('butImport').click();

Any help would be awesome! :o)

SOLVED! :o)

 $('#OIPHPFrame').contents().find('#password_box').val($("#Password").val());
 $('#OIPHPFrame').contents().find('#butImport').click();

David


I think...

$('#OIPHPFrame')[0].find('#email_box').val();
$('#OIPHPFrame')[0].find('#butImport').click();

...should work.

0

精彩评论

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