How to copy all the attributes of one element and apply them to another?

后端 未结 11 1134
灰色年华
灰色年华 2020-11-28 06:50

How do I copy the attributes of one element to another element?

HTML

 attributes and apply them on 
$.each(attributes, function() { $div.attr(this.name, this.value); }); alert($div.data("foo"));

提交回复
热议问题