jquery multiple click issue
<p>I have the following jquery code:</p>

<pre><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("&lt;div id='input_table'&gt;" + table + "&lt;/div&gt;");
                });
            }   
        });
   });
</code></pre>

<p>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...</p>
