Watch.JS
Watch.JS copied to clipboard
Watch HTML property without breaking functionality
Any possible solutions to maintain the setter functionality of standard HTML element properties while watching them with Watch JS?
Example:
var element = document.createElement('div');
element.id = 'myId'; // This will set HTML attribute to 'myId'
console.log('Element:',element); // HTML attribute has been assigned properly
WatchJS.watch(element, 'id', function(){console.log('Element ID changed')});
element.id = 'aNewId'; // This should set HTML attribute to 'aNewId'
console.log('Element:',element); // However, WatchJS has broken this functionality
+1. The same happens with inputs.