Q:

Pass two value from select box once its get selected

Am having a requirement to get two relative values when changing a select box. Am having a multiple select box which containing some options used to present user resources. Some options are representing parent resources. So I need to get the selected value as well as whether its a parent or not.
<select class="filtered remaining" onchange="check_options(this)" id="multi-select-left" multiple="multiple" style="height: 15em;">
    <option parent="0" value="1">User</option>
    <option parent="1" value="2">User-Login</option>
    <option parent="1" value="8">User-Logout</option>
    <option parent="1" value="11">User-Register</option>
    <option parent="0" value="3">Backend</option>
    <option parent="0" value="4">Settings</option>
    <option parent="4" value="5">Settings-Edit</option>
    <option parent="0" value="6">Category</option>
    <option parent="6" value="7">Category-add</option>
    <option parent="0" value="12">logger</option>
    <option parent="0" value="13">brands</option>
    <option parent="0" value="14">User-Role</option>
</select>

is there anyway to get the parent="0" value when selecting a option. I have tried dozen of things, nothing worked. :(
This is my check_options method
function check_options(val)
{
var test = $(val).children("option").filter("parent").text();
alert(test);

}

A:

try this code:
JS Fiddle: http://jsfiddle.net/reigel/frFa9/
 $('#multi-select-left').change( function() {
    var $t = $(this);    
    var tVal = $t.val();    
    var tParent = $t.find('option:selected').attr('parent');

    alert( 'tVal: ' + tVal);
    alert( 'tParent : ' + tParent );
    });

