Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to change data value in jquery

$('.toggle img').each(function(index) { 
    if($(this).attr('data-id') == '4')
    {
        $(this).attr('data-block', 'something');
        $(this).attr('src', 'something.jpg');
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #data #jquery
ADD COMMENT
Topic
Name
6+3 =