2016-10-20 51 views
0

私は動的に生成される子HTMLを持つHTMLページを持っています。私はいくつかの子HTML要素のスタイルを変更したいが、私はアクセスとしてクラスを持っている子HTMLのdivをアクセスするにはどうすればよいの子HTML要素のいずれかをiframe要素セレクタにアクセスするには?

<!DOCTYPE html> 
<html lang="en"> 
<head> 
link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"> 
<link rel="stylesheet" href="new.css"> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 

<body> 
<iframe id="cartoonVideo" src="http://www.youtube.com/embed/ABCDEFGH" frameborder="0" allowfullscreen></iframe> 

**Child html gets generated here** 

#document 
<!DOCTYPE HTML> 
<head> 
link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"> 
<link rel="stylesheet" href="new.css"> 
</head> 
<body> 
<div class="access"></div> 
</body> 
</html> 


</body> 
</html> 

にアクセスすることはできませんよ。 CSSまたはJavaScriptまたはJQueryメソッドのいずれかを使用しますか?これはあなたのiframe内のHTMLコンテンツを返す()

+1

は、私たちはそれを行うためにあなたの目標を教えてください。このビデオコンテンツを自動再生したい場合は、代わりの解決方法がありますが、このコンテンツを変更するには、** corx orign **の問題を参照する必要があります。それは難しいでしょう。 – Technacron

+0

推定重複 - http://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe –

答えて

0

利用機能の内容

$("#cartoonVideo").contents().find('.access') 
関連する問題