[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 64
  • Last Modified:

Select Options, more data

Is there a way to add additional information to a select options ?
<select>
<option name="option_one" id="option_one" ADDTIONAL DATA="additional_data_one" ADDTIONAL DATA="additional_data_two">OPTION ONE</option>

<option name="option_two" id="option_two" ADDTIONAL DATA="additional_data_one" ADDTIONAL DATA="additional_data_two">OPTION TWO</option>
</select>
0
rgranlund
Asked:
rgranlund
1 Solution
 
Tom BeckCommented:
Of course. Use the data- attribute.

Example:
<option name="option_one" id="option_one" data-whatever="additional_data_one" data-something="additional_data_two">OPTION ONE</option>

http://www.w3schools.com/tags/att_global_data.asp
0
 
Dave BaldwinFixer of ProblemsCommented:
I'm not sure what the point of all that is since you have no 'value' in your options.  The 'value' is what gets submitted when you submit the form.
http://www.w3schools.com/html/html_form_elements.asp
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now