Multi values in select options

Multi values in select options.

Hi all

I have a simple select drop down menu here with values for each option that I can capture with Jquery.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="" xml:lang="en" lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<script src="" type="text/javascript"></script>
	<style type="text/css">

  <form action="" method="">
    <select id="select">
      <option value="One" value1="OneOne">One</option>
      <option value="Two">Two</option>
      <option value="Three">Three</option>
      <option value="Four">Four</option>
      <option value="Five">Five</option>
    <input type="submit" name="submit" id="set" value="Set" /> 

  <script type="text/javascript">
      var val = $('#select').val();

Is it possible to have more than one value in each option that I could then capture with jQuery.

So could I have

<option value="One" value1="OneOne">One</option>

and then capture it like

var val = $('#select').val();
var val1 = $('#select').val1();

This doesn’t work but is it possible to do this another way?

You could delimit the values then let the receiving script split them out:

<option value="Red|Green|Blue">One</option>

They could be split up with:

var values = $('#select').val().split('|');
// values[0] is 'Red', values[1] is 'Green', etc...