Answers for "set attribute using each jquery"

0

set attribute using each jquery

$( document ).ready(function() {

    $.each($('div'), function (index, item) {
        $(item).attr('data-testdata', index);
    });

});
Posted by: Guest on September-23-2021

Code answers related to "set attribute using each jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language