Watch.JS icon indicating copy to clipboard operation
Watch.JS copied to clipboard

Watch HTML property without breaking functionality

Open ldstein opened this issue 11 years ago • 1 comments

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

ldstein avatar Jun 13 '13 08:06 ldstein

+1. The same happens with inputs.

martinschaer avatar Dec 03 '13 14:12 martinschaer