change value of data javascript code example Example: change data js $('.my-class').attr('data-num', 'myValue');