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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:50:41+00:00 2026-06-06T00:50:41+00:00

I have a custom styled drop-down selection box created with CSS/Javascript, which is meant

  • 0

I have a custom styled drop-down selection box created with CSS/Javascript, which is meant to imitate a <select> element. The box is a <div> with an internal list composed of <li> elements, which mirror the <option> elements of a standard select box.

Now, a standard select <option> element has two important components: the internal text node, which is what is actually displayed onscreen in the drop-down, and a value attribute which is the string that indicates the value of the selection (for use with form submissions or Javascript).

With my custom box, the text node inside the <li> element mirrors the internal text node in an <option> element. But how should I mirror the “value” attribute? According to w3schools (not the best resource, I know), the LI element has a “value” attribute which can be used, but it is deprecated in favor of CSS styling. But what CSS attribute can be used to indicate the “value” of the List Element? Or is there some better way to associate a value with an LI element?

  • 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-06T00:50:43+00:00Added an answer on June 6, 2026 at 12:50 am

    Any attribute starting with “data-” is valid html nowadays. So you could do something like:

    <ul>
        <li data-value="1">Option #1</li>
        <li data-value="754">Option #2</li>
    </ul>
    

    That way you could easily access your value for each option at a later stage.

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

Sidebar

Related Questions

im using a joomla 1.6.4 install and have a custom css/javascript drop-down menu in
I have created a custom style sheet that overrides the original CSS for my
am trying to use javascript for custom styled select boxes from www.gerrendesign.com/entry_images/selectboxdemo.zip and as
Ok, i have creted my own drop down box. I have a Div, and
I have created a custom style and template for MenuItem and ContextMenu, and for
I have created a default style for a Button including a custom ControlTemplate like
I have an XSL style sheet for which I need to add some custom
Cause I have a custom styled / positioned button. Currently, our set up is:
I have a parent Div : <div id=ctl00_MainContentAreaPlaceHolder_deliveryOpen class=delivery_open style=display: block;> //Child select Element
I have a Google map I created in Javascript using the v3.8 api: var

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.