Reputation: 1529
Here is the jsfiddle code
I found this problem during a CodeAcademy lesson.
Same goes for .addClass, .toggleClass
$(document).ready(function() {
$('#title').click(function() {
$(this).removeClass('.highlighted');
});
});
Upvotes: 2
Views: 223
Reputation: 6219
Don't put dot -----> [ . ] before the class name remove that then it will work fine :) Use this
$(document).ready(function() {
$('#title').click(function() {
$(this).removeClass('highlighted');
});
});
Upvotes: 2
Reputation: 3126
try this
$(document).ready(function() {
$('#title').click(function() {
$(this).removeClass('highlighted');
});
});
Upvotes: 2
Reputation: 7892
try this
$(this).removeClass('highlighted');
Documentation:
http://api.jquery.com/removeClass/
Upvotes: 4