如何使用JQuery删除iframe中的元素?

汉斯·恩

我已将链接元素添加到iframe的(ivuFrm_page0ivu1)内容中,并希望在选择按钮时将其删除。我正在使用的代码在这里:

function removeAddedElements(){

console.log("called removeAddedElements()");
$("#ivuFrm_page0ivu1").contents().find(".linkUp").each(function (index, element) {
    $(this).remove
    console.log("removed one linkUp");
});
}

它会遍历我拥有的四个元素,但不会删除它们。他们保持可见。如何删除这些?

什里尼瓦斯派(Shrinivas pai)

.remove在中不是有效的函数jquery尝试$(this).remove()

function removeAddedElements(){

    console.log("called removeAddedElements()");
    $("#ivuFrm_page0ivu1").contents().find(".linkUp").each(function (index, element) {
        $(this).remove()
        console.log("removed one linkUp");
    });
    }

这里的文件

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章