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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:28:07+00:00 2026-06-09T12:28:07+00:00

how can i add <div> or a <span> tag inside an <option> tag? I

  • 0

how can i add <div> or a <span> tag inside an <option> tag?

I want the row to be <option> of course it has a value and everything, but I need to put a circle red color next to the text in that option, is that possible?

code like:

<option value="1">text<div style='background:none repeat scroll 0 0 green;height:25px;width:25px;'></div></option>
<option value="2">text<div style='background:none repeat scroll 0 0 green;height:25px;width:25px;'></div></option>
<option value="3">text<div style='background:none repeat scroll 0 0 green;height:25px;width:25px;'></div></option>
<option value="4">text<div style='background:none repeat scroll 0 0 green;height:25px;width:25px;'></div></option>
  • 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-09T12:28:08+00:00Added an answer on June 9, 2026 at 12:28 pm

    2019 UPDATE

    This solution doesn’t work anymore.

    Checked in latest Chrome, Firefox and Safari.


    It is possible to put a red circle after the text – http://jsfiddle.net/V8cvQ/

    option:after {
        content: " ";
        height: 5px;
        width: 5px;
        background: #c00;
        border-radius: 5px;
        display: inline-block;
    }
    

    …

    UPDATE

    To have different color dots

    HTML

    <select>
        <option> select </option>
        <option class="red"> one </option>
        <option class="green"> two </option>
        <option class="blue"> three </option>
    </select>
    

    CSS

    option:after {
        content: " ";
        height: 5px;
        width: 5px;
        border-radius: 5px;
        display: inline-block;
    }
    
    option.red:after { background: #c00; }
    option.green:after { background: #0c0; }
    option.blue:after { background: #00c; }
    

    DEMO

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

Sidebar

Related Questions

My question is somewhat weird, but can i add events for any DOM elements(div),
I want to dynamically add a textbox to a span or div or whatever..
I can add a normal rightBarButton to my navigation without a problem but now
I can add a Conditional statement to a breakpoint, for instance arg0.startsWith(something) but i'd
Hope you can help. I'm looping through two selectors: $('.div').each(function() { $('.selector1, .selector2 option:selected').text();
I have an html where i want to add another div within the description
How can I add 80% of the value of variable a (it is a
So I have a div that can have several divs inside of it. Something
I can add and remove the last line in my dynamic form and calculate
We can add an image to an photo album using UIImage *img = [UIImage

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.