I am trying to find out how to show/hide an element depending on the fact whether the element ".question a" has the class "checked" or not. But it isn't working. Anybody knows why ;( ?
$().ready(function() {
var myLink = ".question a";
if (myLink.hasClass('checked')) {
$('.answer').show(300);
}
else {
$('.answer').hide(300);
}
});
var myLink = $(".question a");