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 6792339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:57:25+00:00 2026-05-26T17:57:25+00:00

I have the following jquery code: $(document).ready(function() { $(#build_table, a.coursename, .Start Date, .Book Title,

  • 0

I have the following jquery code:

$(document).ready(function()
   {

        $("#build_table, a.coursename, .Start Date, .Book Title, .Book Author, .Book Isbn").click(function()
        {
            var whichButton = $(this).attr("class");
            console.log("Whichbotton = " + whichButton);
            var prog = $("#program option:selected").text();
            var sch = $("#school option:selected").text();
            var trm = $("#term option:selected").text();
            var ext = $("#extension option:selected").text();
            if(prog == "" || sch == "" || trm == "")
            {
                alert("Please enter a selection for each field");
            }
            else
            {
                $.get("build_table.php", {program: prog, school: sch, term: trm, extension: ext, button: whichButton},
                function(table)
                {   console.log("Entered table function");
                    $("#input_table").replaceWith("<div id='input_table'>" + table + "</div>");
                });
            }   
        });
   });

At the way beginning, I have a click function which I want to work for multiple butttons. This code will call a php file to build a table, and the resulting table headers have different class names (such as coursename). But it doesn’t actually work for coursename, Start date, etc, only for build_table which was the button that built the table in the first place. Am I missing something? I know that the names are correct, I even tried to take the space out of one of them (a.coursename) and that still didn’t 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-05-26T17:57:25+00:00Added an answer on May 26, 2026 at 5:57 pm

    I have implement this and its work..

    HTML code:

    <input type="button" value="Build table" id="build_table"/>
    <input type="button" value="Course name" class="CourseName"/>
    <input type="button" value="Start date" class="StartDate"/>
    <input type="button" value="Book title" class="BookTitle"/>
    <input type="button" value="Book author" class="BookAuthor"/>
    <input type="button" value="Book isbn" class="BookIsbn"/>
    

    jquery code:

    $(document).ready(function(){
        $("#build_table, .CourseName, .StartDate, .BookTitle, .BookAuthor, .BookIsbn").click(function(){
                alert("Yehh!! Its wroked :)"); 
                //your further code
    
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: $(document).ready(function() { // Manage sidebar category display jQuery(#categories >
I have the following JQuery code: // When the document is ready, start firing
i have the following jquery code: $(document).ready(function() { $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select').change(function() { //
I have the following jquery code. var destTable = $(#numbers); $(document).ready(function() { $(#btnAdd).click(function() {
I have the following jquery code $(document).ready(function() { //Default Action $(#playerList).verticaltabs({speed: 500,slideShow: false,activeIndex: <?=$tab;?>});
http://jsfiddle.net/yrM3H/2/ I have the following code: jQuery(document).ready(function() { jQuery(.toggle).next(.hidden).hide(); jQuery(.toggle).click(function() { $('.active').toggleClass('active').next('.hidden').slideToggle(300); $(this).toggleClass('active').next().slideToggle(fast); });
I have the following jQuery code, which works fine: $(document).ready(function () { $('#link1').click(function ()
this is my first question here. I have the following jquery code: $(document).ready(function(){ $(a).click(function(){
I have the following jquery-code: <script type=text/javascript> $(document).ready(function() { $ ('ul.image-list li:even').addClass ('even'); $
I have the following code: jQuery(document).ready(function() { setTimeout($('#loading').fadeIn('slow'), 9999); }); which should slowly fade

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.