iframe的备用文字

iframe的备用文字,第1张

iframe的备用文字

由于我的第一次尝试曲解了您的问题,因此请尝试以下 *** 作:

<script>$(function () {    $("iframe").not(":has([src])").each(function () {    var ifrm = this;    ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentdocument.document) ? ifrm.contentdocument.document : ifrm.contentdocument;    ifrm.document.open();    ifrm.document.write($(this).attr("alt"));    ifrm.document.close();    });});</script>

这将读取任何不具有src属性或具有空白值的src属性的iframe的“ alt”标记值,并将alt文本写入该iframe的主体中。



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4962647.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-13
下一篇 2022-11-13

发表评论

登录后才能评论

评论列表(0条)

保存