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
Related Contents:
- Selecting element by data attribute with jQuery
- jQuery how to find an element based on a data-attribute value?
- 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
- How to set data attributes in HTML elements
- JQuery .data() not working?
- Firing events on CSS class changes in jQuery
- How to select html nodes by ID with jquery when the id contains a dot?
- Determine if $.ajax error is a timeout
- Can you have multiple $(document).ready(function(){ … }); sections?
- What does jquery $ actually return?
- get CSS rule’s percentage value in jQuery
- jquery IDs with spaces
- How to remove close button on the jQuery UI dialog?
- How to enable CORS in flask
- How to get multiple select box values using jQuery?
- jQuery AJAX Character Encoding
- The specified value does not conform to the required format yyyy-MM-dd
- Codeigniter session bugging out with ajax calls
- jQuery – add additional parameters on submit (NOT ajax)
- Hide Twitter Bootstrap nav collapse on click
- jQuery toggle CSS?
- Find size of file behind download link with jQuery
- jQuery exclude elements with certain class in selector
- jquery Setting cursor position in contenteditable div
- Dynamically adding collapsible elements
- How to load a Google Maps map inside of a hidden element
- Append text to input field
- Typewriter Effect with jQuery
- How to add a Not Equal To rule in jQuery.validation
- jquery fill dropdown with json data
- jquery html() strips out script tags
- Exporting PDF with jspdf not rendering CSS
- How to force an HTML form to validate without submitting it via jQuery
- Order of execution of jquery document ready
- linking jquery in html
- Timeout jQuery effects
- jQuery.unique on an array of strings
- Weird Chrome prototype/jQuery conflict
- How to run a jquery function in Angular 2 after every component finish loading
- Trigger Keypress with jQuery
- Detect user scroll down or scroll up in jQuery [duplicate]
- $(”) vs $(”) in jQuery
- jQuery: dealing with a space in the id attribute
- How do I explicitly execute default action from jQuery event
- How to get the id of the element clicked using jQuery
- Get index of selected option with jQuery
- Autocomplete issue into bootstrap modal