Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:23:28+00:00 2026-05-25T14:23:28+00:00

I kind of know how Modernizr works, by adding a Class to the <html>

  • 0

I kind of know how Modernizr works, by adding a Class to the <html> element, I know that jQuery Browser Detection is deprecated, is there a way to detect and add a class ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:23:28+00:00Added an answer on May 25, 2026 at 2:23 pm

    Detecting a browser is not difficult (though generally not recommended and occasionally inaccurate). If you’re familiar with modernizr, then you should know that feature detection is much more maintainable and accurate mechanism for identifying which behavior you should use in the host browser. For actual browser detection (again, not recommended), I’d suggest reading this Mozilla article: https://developer.mozilla.org/En/Browser_Detection_and_Cross_Browser_Support.

    For setting a class, that’s much easier. To set a class on the body object, you would just do this:

    document.body.className = "xxxx";
    

    or to add a class, you would use this:

    document.body.className += " xxxxx";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this is a you-should-know-this kind of question (Somebody told me that there
I have method that returned NSManagedObject and I don't know what kind of NSManagedObject
I know that this kind of issue is most discussed. But I would like
I know that properties kind of encapsulate getter and setter methods. So whenever we
I know this question has kind-a started religious wars in past and there might
I would like to know what kind of limitations there are in using websockets.
I know it kind sounds silly ... it should work there ... but :
I'd like to know what kind of performance impact Html helpers have on C#
I kind of know how preg_replace works but I am horrible with regex. Here
I know this kind of question has been asked before, but there is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.