0

Here is my code

As you can see, click the button month , it will appear a input filed.
Then click the input filed, you can choose month

I want to know how to trigger the month picker directly when click the month button
whithout click the input field again but not works well:

$("#Btn").click(function () {                                     
    $("#month").trigger("click");
});  
1
  • 1
    It's not clear what you are asking but I suspect what you are looking for is $('#month').focus(). Commented Sep 27, 2015 at 10:30

1 Answer 1

1
  $("#Btn").click(function () {                 
                    $(".test").show();
                    $("#month").trigger("focus");
                }); 

monthpicker uses focus event, it seems, not click.

Demo: http://jsfiddle.net/m43acyfu/2/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.