Созонов Алексей

Веб-разработчик

Скопировать все атрибуты одного элемента в другой

01.10.2015

var $select = $("select");
var $div = $("div");

var attributes = $select.prop("attributes");

// loop through select attributes and apply them on div
$.each(attributes, function() {
    $div.attr(this.name, this.value);
});

alert($div.data("foo"));

#JQuery‏‎