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

  • SEARCH
  • Home
  • 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 8644979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:25:54+00:00 2026-06-12T12:25:54+00:00

I have lot of html page that use the old nested list that does

  • 0

I have lot of html page that use the old nested list that does not work correctly. I would like to dynamically look if a page uses it and add a class attribute or suggest the better way to do this.

Dynamically update all occurrences of

<ol type="a"> to <ol class="alpha">

Or suggest if there a way I can still use the type but apply a style using embedded CSS?

  • 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-06-12T12:25:55+00:00Added an answer on June 12, 2026 at 12:25 pm

    Without using JavaScript, you could use a CSS attribute-selector:

    ol[type=a] {
        color: red;
    }
    

    JS Fiddle demo.

    It’s important to note that this may also ‘not work correctly’ (a phrase I missed when first reading your question), depending upon how the ‘not working’ manifests itself, or what it is that doesn’t work.

    If you feel you must use JavaScript, then the following works:

    var ols = document.getElementsByTagName('ol');
    
    for (var i=0, len=ols.length; i<len; i++){
        ols[i].className = ols[i].type == 'a' ? 'alpha' : '';
    }
    

    JS Fiddle demo.

    If you want to remove the type attribute once the class is set:

    var ols = document.getElementsByTagName('ol');
    
    for (var i=0, len=ols.length; i<len; i++){
        if (ols[i].type == 'a') {
            ols[i].className = 'alpha';
            ols[i].removeAttribute('type');
        }        
    }
    

    JS Fiddle demo.

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

Sidebar

Related Questions

I have an HTML page with lot of tables. Among that I have a
I have a lot of web pages that use the same exact html structure.
I have two files: master/newsletter1/file.html master/newsletter2/file.html newsletter1/file.html has a lot of new changes that
I have an HTML page where I want to refresh a lot of images
I have an html page that is displayed on a television screen sort of
I have a lot of <a> html tags without the href attribute for making
I have a lot of files such as JavaScript, HTML, and even C and
I have a HTML which has lot of content and a vertical scrollbar appears
I have lot of code in my Tornado app which looks like this: @tornado.web.asynchronous
I have a requirement to use date picker in my applicaiton. I have lot

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.