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

  • SEARCH
  • Home
  • 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 8880587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:11:29+00:00 2026-06-14T20:11:29+00:00

I am using a Jquery plugin to switch panel. After I switch panels I

  • 0

I am using a Jquery plugin to switch panel. After I switch panels I need to add a datepicker to an input, but I need to attach the plugin after the panel is added. I want to do this with the on() function, but I cannot seem to make it work. From what I understand you have to use an event, but is there a way to make an event out of a div being added. The code that I have been trying is with a “click” event, this adds the datepicker with the first click and then it will work on the second click. I need it to work on the first click. Also it is not adding the icon like I need. Here is the code that I am using right now:

  $('#switcher-panel').on('click', 'table tr td input', function(){
    $('.datepicker').datepicker({
      buttonImage: "images/calendar.png"
    });
  });

Here is the html that is switching the panels:

<a id="content1" class="switcher">Rank 1</a>
<a id="content2" class="switcher">Rank 2</a>

<!-- The panel you wish to use to display the content -->
<div id="switcher-panel"></div>

<!-- The actual content you want to switch in and out of the panel, this is hidden -->
<div id="content1-content" class="switcher-content show">
</div>

How would I use the on function to make this 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-14T20:11:30+00:00Added an answer on June 14, 2026 at 8:11 pm

    on() is not capable of running a plugin like datepicker. You need to call the plugin after you insert the new html.

    Something along th lines of this simple append:

    $('#someDiv').append('<input class="datpicker"/>').find('.datepicker').datepicker();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Supersized jQuery plugin. My images are 1600x672 , but it always resize
I'm using the struts2-jquery plugin I need to set a default value for the
I am using a Jquery plugin called Jquery Content Panel Switcher. It does exactly
I'm using Backstretch jQuery plugin to create full screen background images, but have a
I am using the jQuery datepicker plugin. I can get the month number by
Using jQuery plugin jEditable. Problem I'm having is that I want whatever is editable
I'm currently using this plugin: http://github.com/davist11/jQuery-One-Page-Nav but would prefer to switch to using Twitter's
I'm using the bootstrap datepicker plugin and I need to overload the headTemplate object
am using jquery tablesorter plugin and in my country column i got special characters
im using fullcalendar jquery plugin in my web. i have a problem in which

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.