-1
我想在iframe中找到src並在jquery中添加autoplay=1
。我想要找到iframe中的src,並且必須添加autoplay=1
,現在我沒有找到src和追加autoplay=1
找到屬性'src'並在jquery中添加'autoplay = 1'
$('.flex-active-slide iframe').contents().find("iframe").contents().find("src").append($("&autoplay=1"));
jQuery(document).ready(function($){
$(".playButton").on('click',function(){
$('.flex-active-slide iframe').contents().find("iframe").contents().find("src").append($("&autoplay=1"));
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="playButton">Play</div>
<div class="flex-active-slide">
<iframe src=""> <!--But refering this-->
#document
<html>
<body>
<iframe src=""><!--want to refer this iframe -->
#document
<html>
<body>
</body>
</html>
</iframe>
</body>
</html>
<iframe>
</div>
問題在哪裏? – Sojtin