我有一张图片通过插件显示为我页面上的背景,我试图在页面其他地方的 DIV 中显示该图片的 ALT 文本。
这是即将出现的代码:
<!-- Background Manager Start -->
<div id="myatu_bgm_img_group" class="myatu_bgm_fs" style="overflow: hidden;"><script type="text/javascript">
/*<![CDATA[*/
try{(function(a){myatu_bgm.addTopImage("",function(){if((typeof myatu_bgm!=="undefined")&&(myatu_bgm.initial_ease_in==="true")){a(this).fadeIn("slow")}else{a(this).show()}})}(jQuery))}catch(e){};
/*]]>*/
</script><noscript><img id="myatu_bgm_top" class="myatu_bgm_fs" src="http://mgrezova.webfactional.com/wp-content/uploads/2013/06/agnesbshirt.jpg" alt="Caption Text" /></noscript></div>
<!-- Background Manager End -->
有人可以建议 javascript 或其他东西,让我可以在以下 DIV 中输出“标题文本”吗?
<DIV class="quote">
<DIV class="inner-quote">
</DIV>
</DIV>
非常感谢任何帮助。
最佳答案
试试这个:
$('.inner-quote').html($('#myatu_bgm_top').prop('alt'));
关于jquery - 在页面上的 div 中显示图像替代文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18696913/