Hi,
I have been wondring how i can create functions like jQuery of the style
$(ID).function()
where ID is the id of an HTML element and function is a javascript function.
where the $(ID).function() is called when the html element is painted
Printable View
Hi,
I have been wondring how i can create functions like jQuery of the style
$(ID).function()
where ID is the id of an HTML element and function is a javascript function.
where the $(ID).function() is called when the html element is painted
What you're looking for is method/function chaining or alternatively cascades. The methods in the chain need to return this.
Just a quick google for 'javascript chaining'.
http://css.dzone.com/news/javascript...ing-your-metho
I'm sure there's many more.
RPG