I have a form with id commentform, and if any registered user visits the page, the tag is pgenerated in the form, which is with the class logged-in-as. Now I'm trying to check if this exists p, and if not, then do my check, which uses keyup(). Here is a small snippet ...
$('form#commentform').keyup(function() {
if( ! $(this).has('p').hasClass('logged-in-as') ) {
....
} else {
......
}
}
});
Now the problem is that it if( ! $(this).has('p').hasClass('logged-in-as') )does not return me the expected result, whether or not the specific one exists p.
Can any of you tell me any other / best way to test this?
source
share