This repository was archived by the owner on Jan 30, 2021. It is now read-only.
forked from ilgilenio/Otag
-
Notifications
You must be signed in to change notification settings - Fork 0
.resp
Alper Kürşat edited this page May 24, 2018
·
1 revision
.resp( {Property:Response} Object )
.resp( Property String , Response Function )
You can define responsive property to an Element
.resp method allows you to define function to Element which you are able to access old and new value of the property.
You can access to Element via this; old value of the Property'via this.Property, new assigned value will be the first arguement of the function you define.
let Num='Num'
.prop({value:5})
.resp('value',function(newValue){
console.log('Change:',newValue-this.value);
})
Num.value=15; // logs: Change: 10If there is no change when set, your function won't be called.
| ©️ Copyright | 2018 | |
|---|---|---|
| Otağ™ JS | ilgilenio® ⚙️ open source |