Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9257477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:10:15+00:00 2026-06-18T12:10:15+00:00

edit A: this is NOT a jquery question, but rather a jquery Mobile question.

  • 0

edit A: this is NOT a jquery question, but rather a jquery Mobile question.

edit B: I changed the title … originally I asked how to fire ‘click’ event specifically, but apparently the ‘click’ event is not the proper event to use if you want to re-create a jqm:Select Menu choice.

how to programatically fire an event on a jquery mobile select menu?

<select id       = 'my_select'   
        name     = 'my_select'   
        onchange = 'gf_handle_change( this.value );' >
  <option id = 'option_A'  value = 'A'> A </option>
  <option id = 'option_B'  value = 'B'> B </option>
</select>

<script>
  function gf_fire_event( args_val )
    { alert( 'test : ' + jQuery( '#option_' + args_val ) ) ; 
      jQuery( '#option_' + args_val ).trigger( 'click' ) ;
    }
  function gf_handle_change( args_val )
    { alert( args_val )  ;
    }
  gf_fire_event( 'A' ) ;
</script>

This does not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:10:16+00:00Added an answer on June 18, 2026 at 12:10 pm

    Here’s an example:

    $(document).on('pagebeforeshow', '#index', function(){       
        $("#test-button").on( "click", function(event, ui) {
          $('#my_select option#option_B').trigger('click');    
        });
    
        $("#my_select option").each(function(){
            $(this).on( "click", function(event, ui) {
              $(this).attr('selected' , true);
              $('#my_select').selectmenu('refresh');                
            });         
        });    
    });
    

    Working jsFiddle example: http://jsfiddle.net/Gajotres/RZ68b/

    One more thing, do not use onclick=”… or onchange=”… with jQuery Mobile, this could case problems with event triggering. Always bind your event programatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question at jquery forum cf: my question , but was asked
edit: this question was closed as a duplicate, but the identified duplicate was asked
[edit] I am NOT using jquery in this app. Looking for a way to
Not entirely sure of a good title for this, feel free to edit it
I appreciate this may not be a great question, but I'm at my wits
EDIT This question is NOT a dupe of Setting "checked" for a checkbox with
EDIT : this question is very similar to this one but it's more conceptual
a while ago i asked this question Jquery tabs keep tab open that is
This is clearly not the case though. My JS : $(.job_charge.item-block).live({ mouseenter: function(){ $(this).find('.edit-and-delete').stop(true,true).fadeIn();
This works: Entities.WorkOrderSet.Where(MyCustomMethod); This does not: Entities.WorkOrderSet.Where(o => MyCustomMethod(o)); ( [Edit] Even without new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.