element.onclick = function() {this_is_my_function($param)}
The tricky part is that the value of the onclick is a reference to the function and not the function itself. So if you simply put:
element.onclick = this_is_my_function($param)
It would actually fail. You need to wrap this under another function, hence the original code where the function() calls the this_is_my_function().
1 comment:
thanks for sharing the blog
web development
best web development company
top web development company
Webistick - Web Development & Design Company
Post a Comment