Is there a way to create a setter that changes the property of any object when a DOM element updates it?
I do not believe this. Without making a setter, then But there is a small thing to keep in mind, x will hang a simple Jane property object, when there will be no change in knowing. Why do you want to avoid Setter? This is a very clear way to accomplish your goal.
object.definproperty , although more verbose is more supported, and win
set and
Get :
a = {}; Object.defineProperty (a, 'x', {get: function}} set this return._x;} function: (newX) {this._x = newX; $ ("# my_element"). Html (newX); }});
No comments:
Post a Comment