views:

1523

answers:

3

Hi, I m having a problem in chrome with the following:

var items = $("option", obj);  
   items.each(function(){
    $(this).click(function(e){
                                        //alert("test");
     process($(this).html());
     return false;
    });
   });

The click event doesnt seem to fire in chrome! In firefox it works!I wanna be able to click on a option element from a combo, if I do instead another kind of element, lets say <li> it works fine. Any idea? Thanks

+3  A: 

I don't believe the click event is valid on options. It is valid, however, on select elements. Give this a try:

$("select#yourSelect").change(function(){
    process($(this).children(":selected").html());
});
Stuart Branham
This worked for me! Thanks Stuart
Chris Schmitz
A: 

According to w3schools, the click event on options is valid though. http://w3schools.com/tags/tag_option.asp

Sixtease
A: 

Thanks for the post, it solved my problem with chrome

Cure