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 6027067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:32:12+00:00 2026-05-23T04:32:12+00:00

I am attempting to remove a class from an html tag using JavaScript but

  • 0

I am attempting to remove a class from an html tag using JavaScript but I have no idea where to start. I have searched but to no avail. While I am decently fluent in jQuery, I am not in JavaScript and I need to use JavaScript in this instance Anything I have found thus far would need to be adjusted for my own use, which I have not been successful at. Hopefully someone can explain it in a fool-proof way.

The element the class is attached to is the “ul” tag. The class is named “nojavaScript” and is only applied to this single instance of the “ul” tag. While as I said the class is only used once in the page, the “ul” tag is used in other instances with different classes or ids.
If it would make it easier for the JavaScript, I can change the class to an id.

I hope I have given you enough to go on. I will include an example of the html code below.

<ul id="lines_list" class="nojavaScript"></ul>

As I mentioned, if it’s easier to remove an id than a class, I can make the current id a class, and the current class an id. But essentially it’s the “nojavaScript” that needs to be removed.

Thanks!

  • 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-23T04:32:13+00:00Added an answer on May 23, 2026 at 4:32 am
    function removeCSSClass(element, className) {
        var cssClass = ' ' + element.className + ' ';
        var index = cssClass.indexOf(' ' + className + ' ');
        if (index >= 0) {
            var newClass = cssClass.substr(0, index) + ' ' + cssClass.substr(index + className.length + 1);
            element.className = newClass;
        }
    }

    UPDATE: code now works in all occassions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to create C#-like multicast delegates and events using features from TR1. Or
So, i'm attempting simple card game. I have player class with draw function, and
I am attempting to pull some information from my tnsnames file using regex. I
Attempting to print out a list of values from 2 different variables that are
Attempting to deploy a MOSS solution to a UAT server from dev server for
When attempting to open a project from source control on a newly formatted pc,
I'll start off by saying I'm new to jQuery but I am really enjoying
I'm attempting to use JQuery to create a dynamic page header using an image
Hi I'm attempting to use the ASPFPDF class to output an image on a
I have a typical Silverlight application with a WCF service and I am using

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.