Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ID「test」のdivがあります。その中には、ID のない iframe があります。この iframe の本文コンテンツにアクセスする必要があります。JS/Jquery を使用してそれを行う方法は?
次のようにアクセスします。
$('#test>iframe').contents.find('body') // This will get you body tag
jqueryがそれを行います。
var objiframe=$('#test').find('iframe');
iframeあなたが入るでしょうobjiframe
iframe
objiframe
次にobjiframe、セレクターで使用して、iframeの属性とコンテンツを取得または設定します。