What will be the result of the code?

$('button').on('click', function(){
    this.attr('class', 'clicked');
});
Explanation
There will be a TypeError: this.attr is not a function, because 'this' refers to a DOM element

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
JavaScript quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes