I must have misunderstood, but I thought that the data-value of a HTML-element changes when calling the jQuery .data() function:
<div id="empty_column_0" data-name="empty_column_0" class="settings_toggle toggle-success inline-toggle" data-target="column_0" data-value="0"></div>
When I "toggle" this element, the data-value must change from 0 to 1 and vice versa.
I do this with:
$('.settings_toggle').on('toggle', function (e, active)
{
var that = $(e.target);
//Change the data value of the element
if(active) {var bool = 1;} else {var bool = 0;}
that.data('value', bool);
console.log(that.data('value'));
});
The value changes in the console but not in the HTML? Is this how it is suppose to work?