When you use .data() to update a data value, it is updating internal object managed by jQuery, so it will not be updated in the data-*
attribute
More Related Contents:
- Selecting element by data attribute with jQuery
- jQuery how to find an element based on a data-attribute value?
- How to set data attributes in HTML elements
- jquery get HTML 5 Data Attributes with hyphens and Case Sensitivity
- Unable to set data attribute using jQuery Data() API
- Adding data attribute to DOM
- jQuery find element by data attribute value
- JQuery .data() not working?
- How to check if bootstrap modal is open, so I can use jquery validate?
- How to set minDate to current date in jQuery UI Datepicker?
- Get the offset of a hidden element
- e.preventdefault(); not working
- Is there a callback for Twitter’s Tweet Button?
- Any way to make jQuery.inArray() case insensitive?
- jQuery detect programatic change to field
- jQuery Webpage Preview [duplicate]
- jquery nested ajax calls formatting
- jQuery send HTML data through POST
- is it possible to remove an html comment from dom using jquery
- jquery get number from id
- Selectable optgroup using select2
- jquery click doesn’t work on hyperlink
- Benefits of using attr() over addClass in jquery
- Drag-Drop elements between parent frame and child iframe
- Disable Back Button in Browser using jquery?
- change the href of a css link via jquery
- How can I list the uploads from a YouTube Channel?
- jQuery – Detecting if a file has been selected in the file input [duplicate]
- Jquery .on(‘scroll’) not firing the event while scrolling
- Jquery to open Bootstrap v3 modal of remote url