Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は次のコードを持っています。
$(document).ready(function(){ $('#listing img') .attr('width', 250) .removeAttr('height').removeAttr('align').removeAttr('style') .wrap('<p />'); });
複数の属性を削除するより効率的な方法はありますか?
はい :
.removeAttr('height align style')
ドキュメントから:
バージョン1.7以降では、スペースで区切られた属性のリストにすることができます。