Skip to content
This repository was archived by the owner on Jan 30, 2021. It is now read-only.
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: 10

Caution:

If there is no change when set, your function won't be called.

Clone this wiki locally