如何設(shè)置數(shù)據(jù)屬性而不在jQuery中添加值?我要這個:<body data-body>我試過了:$('body').attr('data-body'); // this is a getter, not working$('body').attr('data-body', null); // not adding anything其他所有內(nèi)容似乎都將第二個參數(shù)添加為字符串。是否可以只設(shè)置沒有值的屬性?
設(shè)置沒有值的屬性
慕婉清6462132
2019-11-30 14:15:20