Search code examples
javascriptprototypejs

Observing blur event for select Prototype


I have

<div id="myselect">

<select>
<option value="0">1</option>
<option value="1">2</option>
</select>

</div>

Im trying to get the value of the select on blur.

So far I have:

    Event.observe('#myselect select', 'blur', function(event) {
        //get value
    });

Please advise!


Solution

  • try this

    $('myselect').down('select').observe('blur', function(e){
        alert('blur');
    });