I know this is pretty basic, but how do I GET the class names that are on the body tag of my page and log them to the console? I have the following:
if (navigator.userAgent.indexOf('OS 4') != -1) $("body").addClass('iOS4');
console.log($(body).attr(class).text());
Will this log out to the console whether or not my body tag has the ‘ios4’ class?
Yes, it will work regardless of whether your body has ‘ios4’ class.