How do I copy the attributes of one element to another element?
HTML
<select id="foo" class="bar baz" style="display:block" width="100" data-foo="bar">...</select>
<div>No attributes yet</div>
JavaScript
var $div = $('div');
var $select = $('select');
//now copy the attributes from $select to $div
You can use the native
Node#attributesproperty: http://jsfiddle.net/SDWHN/16/.