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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:24:04+00:00 2026-06-03T07:24:04+00:00

First of all, I’m fairly new to jQuery and HTMl5/CSS3, so while there is

  • 0

First of all, I’m fairly new to jQuery and HTMl5/CSS3, so while there is probably a simple solution to this, I have been unable to find one on the internet.

I have a PHP script that uses an API call to pull the names of my WoW guild members into a UL with a class to properly color the names for the in game class they are. Now, I want to take that UL and turn it into a select box so the user can pick their character when they register for the site (more security to ensure the player is picking one of their toons is planed for the future).

I want the style of the select box to fit in with the rest of my form, and I want the class colors to show up in the select. I’m assuming I have to cheat and use some form of DIV, but haven’t been able to find a script that does exactly what I’m looking for. The format of my UL is like this:

    <ul id="charNameList">
        <li><span class="priest">Alastriia</li>
        <li><span class="paladin">Aleathà</li>
        <li><span class="warrior">Arghra</li>
        <li><span class="druid">Autumnal</li>
        <li><span class="rogue">Beerisbadmmk</li>
        <li><span class="priest">Biip</li>
        <li><span class="mage">Blazeglory</li>
        <li><span class="druid">Blaçk</li>
        <li><span class="warlock">Braylna</li>
        <li><span class="warlock">Brileah</li>
        ...
    </ul>

Any help is much appreciated, even just pointing me towards a tutorial that my Google skills have failed to find. Thank you 🙂

  • 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-03T07:24:05+00:00Added an answer on June 3, 2026 at 7:24 am

    I believe you are looking for something more like this:

    HTML

    <h3 id="charNameListHeader">Select Your Toon: <span id="selectedToon"></span></h3>
    <ul id="charNameList" style="display:none;">
        <li data-toonID="1"><span class="priest">Alastriia</li>
        <li data-toonID="2"><span class="paladin">Aleathà</li>
        <li data-toonID="3"><span class="warrior">Arghra</li>
        <li data-toonID="4"><span class="druid">Autumnal</li>
        <li data-toonID="5"><span class="rogue">Beerisbadmmk</li>
        <li data-toonID="6"><span class="priest">Biip</li>
        <li data-toonID="7"><span class="mage">Blazeglory</li>
        <li data-toonID="8"><span class="druid">Blaçk</li>
        <li data-toonID="9"><span class="warlock">Braylna</li>
        <li data-toonID="10"><span class="warlock">Brileah</li>
    </ul>
    <input type="hidden" id="selectedToonInput" />
    

    JS

    $('#charNameListHeader').click( function() {
        $(this).next().toggle();
    });
    $('#charNameList li').click( function() {
        var selectedValue = $(this).attr('data-toonID');
        $('#selectedToonInput').val(selectedValue);
        var newToon = $(this).children('span').clone();
        $('#selectedToon').html(newToon);
        $('#charNameList').hide();
    });
    

    JS Fiddle: http://jsfiddle.net/TQNfQ/2/

    From there, you just make it look like you want it to look. The toonID gets set to a hidden input so you can pick it up later when you process the input.

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

Sidebar

Related Questions

First of all Im new to vb 2010 and so far have enjoyed what
First of all I have seen that there are many questions about unrecognized selector
First of all there is a partial question regarding this, but it is not
First of all, my table structure is something similar like this: CREATE TABLE Testing(
First of all, I know I asked a similar question before but this one
First of all Sorry if my question title sounds stupid.... I have the following
First of all, I don't know if this should stay in SO or go
First of all, I know how to build a Java application. But I have
First of all, I'm fairly sure snapping to grid is fairly easy, however I've
First of all i have to those categoryIDs 1-whos parentcategoryID only appears one 2-ParentCategoryID

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.