Events / Try it out


#1

Hey guys, what is wrong with my code?

var main = function() {
$(".btn").keypress(function() {
$this.toggleClass $("btn-like");

});
};

$(document).ready(main);


#2

@pkoczara,
jQuery has a removeClass(), addClass() and toggleClass() Method.
Have a read
http://api.jquery.com/toggleclass/


#3

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.