我已将链接元素添加到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");
});
}
它会遍历我拥有的四个元素,但不会删除它们。他们保持可见。如何删除这些?
.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] 删除。
我来说两句