JQuery的removeProp方法已经被移除了?

今天备课时发现,JQueryremoveProp 方法已被移除,虽然比较常用 removeAttr 这个来移除标签属性,但是我看到好多博客文章都还是说 removeProp 还能用,以下是例子,prop 是能获取合法标签的属性,但是 removeProp 是已经不能删除了标签属性了,建议使用 removeAttr 来移除标签属性, 设置也建议使用 Attr() 来设置

     //为 div 元素添加合法标签 class
     $('div').prop('class','box');
     //此时 div 元素的 class 值为 box
     console.log($('div').prop('class')); // 打印box
     // 已经不能删除了
     $('div').removeProp('class');
    //删除后 div 元素的 class 特性值还是 box 
    console.log($('div').prop('class')); // 打印box

你可能感兴趣的:(JQuery的removeProp方法已经被移除了?)