How do you add a new method called 'debug' to jQuery's objects?
You have to add your function to the $.fn namespace. Please note that inside the function, this will refer to the jQuery object, not a DOM object. Example:

$.fn.debug = function(){

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes