I a trying to check for DIV class in my document.
But it is not working for me,Please help me.. Below is my code
$(document).ready(function()
{
var x=$(this).hasClass('global');
alert(x);
});
And even i have tried below code but still same result..
$(document).ready(function()
{
var x=$('#global').length;
alert(x);
});
It is always showing 0….. 🙁
It’s hard to tell exactly what you want to do but i’ll assume you want to know if there is an item in the DOM with the class you specify.
It’d be simpler if you did: