title: jquery .append() not working for my html
body: <p>I have a program which appends an input(<code>type="hidden"</code>) using jquery, to an html so that when I click the submit button, it passes the value to a php file and I can process it. However, it seems that the hidden type is not really being appended to the html nor it is being passed to the php file. I already used <code>method="get"</code> to see the values in the address bar and <code>print_r</code> to see the values being catched but there's nothing. To check if my form is actually passing a value, I added a </p>
  
  <pre><code>&lt;input type="hidden" name="absent[]" value="testing" /&gt;
  </code></pre>
  
  <p>in the HTML and the value got passed but the ones in the jquery aren't.</p>
  
  <p>Here are my files:
  jquery:</p>
  
  <pre><code>$(function(){
    $("td").click(function(){
   if($(this).hasClass("on"))
   {
      alert("Already marked absent");
  
   }
  else
  {
  
      $(this).addClass("on");
      var currentCellText = $(this).text();
      var temp = $(this).attr('id');
      $("#collect").append("&lt;input type='hidden' name='absent[]' value = '" + temp + "'/&gt;" + currentCellText);
      alert(temp);
  
   }
    });
  
  $("#clicky").click(function(){
      $("td").removeClass("on");
      $("#collect").text('');
      $("#collect").append("Absentees: &lt;br&gt;")
      alert(temp);
  });
  });
  </code></pre>
  
  <p>Here is the html part:</p>
  
  <pre><code>&lt;?php
  session_start();
  include 'connectdb.php';
  $classID = $_SESSION['csID'];
  
  $classQry = "SELECT e.csID, c.subjCode, c.section, b.subj_name, e.studentID, CONCAT(s.lname, ', ' , s.fname)name
  FROM ENROLLMENT e, CLASS_SCHEDULE c, STUDENT s, SUBJECT b
  WHERE e.csID = c.csID
  AND c.csID = '" . $classID . "'
  AND c.subjCode = b.subjCode
  AND e.studentID = s.studentID
  ORDER BY e.sort;";
  
  $doClassQry = mysql_query($classQry);
  
  echo "&lt;table id='tableone'&gt;";
      while($x = mysql_fetch_array($doClassQry))
      {
          $subject = $x['subj_name'];
          $subjCode = $x['subjCode'];
          $section = $x['section'];
          $studentArr[] = $x['name'];
          $studentID[] = $x['studentID'];
  
  
      }
      echo "&lt;thead&gt;";
      echo "&lt;tr&gt;&lt;th colspan = 7&gt;" . "This is your class: " . $subjCode . " " . $section . " : " . $subject . "&lt;/th&gt;&lt;/tr&gt;";
      echo "&lt;/thead&gt;";
      echo "&lt;tbody&gt;";
      echo "&lt;tr&gt;";        
      for($i = 0; $i &lt; mysql_num_rows($doClassQry); $i++)
      {
          if($i % 7 == 0)
          {               
              echo "&lt;/tr&gt;&lt;tr&gt;&lt;td id = '". $studentID[$i] . " '&gt;" . $studentArr[$i] . "&lt;/td&gt;";             
          }
          else
          {
              echo "&lt;td id = '". $studentID[$i] . " '&gt;" . $studentArr[$i] . "&lt;/td&gt;";
          }
  
      }
      echo "&lt;/tr&gt;";       
      echo "&lt;/tbody&gt;";
  echo "&lt;/table&gt;";
  ?&gt;
  </code></pre>
  
  <p>Here's the html part with the form:</p>
  
  <pre><code>&lt;form name="save" action="saveTest.php" method="post"&gt;
  &lt;div id="submitt"&gt;
      &lt;input type="hidden" name="absent[]" value="testing"/&gt;
      &lt;input type="submit" value="submit"/&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And here's the php part which processes the form (saveTest.php):</p>
  
  <pre><code>&lt;?php
  
  $absent  = $_POST['absent'];
  //echo "absnt" . $absent[] . "&lt;br&gt;";
  echo count($absent) . "&lt;br&gt;";
  //print_r($_POST) . "&lt;br&gt;";
  ?&gt;
  </code></pre>