how to change data attribute value in jquery code example
Example 1: jquery set data attribute value
//<div id="myElementID" data-myvalue="37"></div>
var a = $('#myElementID').data('myvalue'); //get myvalue
$('#myElementID').data('myvalue',38); //set myvalue
Example 2: set custom data attribute jquery
//set the custom data value
let mainDiv = $('#yourDivId').data('anyName', value);
//access the custom data value
mainDiv.data('anyName');