title: Codeigniter get the value of a <td> element onclick
body: <p>I am trying to get table data when the user clicks on the text inside  element. I have tried number of java script but I cant get the value to be send back to the controller for further processing. I would really appreciate if you can help me out. I have added necessary code for you to see if I am doing something wrong. </p>
  
  <pre><code>&lt;div class="box-content"&gt;
                            &lt;table id="suppliertable" class="table table-striped table-bordered bootstrap-datatable datatable"&gt;
                        &lt;thead&gt;
                            &lt;tr&gt;
                                &lt;th&gt;Supplier&lt;/th&gt;
                                &lt;th&gt;Open Range&lt;/th&gt;
                                &lt;th&gt;Fill Content&lt;/th&gt;
                                &lt;th&gt;Total Match&lt;/th&gt;
                            &lt;/tr&gt;
                        &lt;/thead&gt;   
                        &lt;tbody&gt;
  
                        &lt;?php foreach($present_all_suppliers as $v): ?&gt;
                                &lt;tr&gt;      
                                      &lt;td class="center" style="color:#0c595b;"&gt;&lt;?php echo $v-&gt;supplierCompany;?&gt; &lt;/a&gt; &lt;/td&gt;
                                      &lt;td class="center"&gt;70%&lt;/td&gt;
                                      &lt;td class="center"&gt;12%&lt;/td&gt;
                                      &lt;td class="center"&gt;82%&lt;/td&gt;
                              &lt;/tr&gt;
                      &lt;?php endforeach; ?&gt;
  
  
                      &lt;/tbody&gt;
                    &lt;/table&gt;            
                  &lt;/div&gt;
  </code></pre>
  
  <p>Java Script:</p>
  
  <pre><code>document.getElementById ( "tdid" ).textContent
  var tdElem = document.getElementById ( "tdid" );
  var tdText = tdElem.innerText | tdElem.textContent;
  </code></pre>