title: How do I get the ID of the clicked <td> for use by jeditable to pass into the loaddata URL?
body: <p>I'm struggling using jeditable to create a JSON list of values from a table, then display them in the td for selection, and then save the new value using save.php. My issue is not with JSON however. Below is the HTML td I'm trying to edit with jeditable.</p>
  <pre><code>&lt;td id=&quot;facility:95633&quot; class=&quot;editable editfacility&quot;&gt;Saint Lukes&lt;/td&gt;
  </code></pre>
  <p>In order to create the dropdown list for selection I must have the value of the id from the clicked td to use in the where clause of the getListOfFacilities.php.</p>
  <pre><code>Function CellEditFunction( jQuery ) {
     Var submitdata = {};
  
  $(&quot;.editfacility&quot;).editable(&quot;save.php&quot;, {
      type       : &quot;select&quot;,
      submit     : &quot;OK&quot;,
      style      : &quot;inherit&quot;,
      loadurl    : &quot;getListOfFacilities.php&quot;,
      Loaddata   : {recordID : this.id.split(&quot;:&quot;).pop()},
  });
  ... and many, many more doing different things
  } // End CellEditFunction
  </code></pre>
  <p>The problem here is I always get an error saying:</p>
  <p>&quot;Uncaught TypeError: this.id is undefined
  CellEditFunction <a href="https://net-control.us/js/CellEditFunction.js:99%22" rel="nofollow noreferrer">https://net-control.us/js/CellEditFunction.js:99&quot;</a></p>
  <p>Line 99 is the loaddata definition. All things work if I pre-define (hardcode) var id=&quot;facility:95633&quot;; before the editable definition, this tells me the rest of the code is working.</p>
  <p>So my question becomes how do I get the value of id from the clicked td? I've googled and I've searched SO and none of those solutions work, such as:
  <a href="https://stackoverflow.com/questions/37474989/jeditable-not-returning-id-value">Jeditable Not Returning &quot;id&quot; Value</a>
  Or
  var id = $('.editable').find(&quot;div:first&quot;).attr(&quot;id&quot;);
  But using parent(&quot;td&quot;), or closest(&quot;td&quot;) does not return the value.</p>
  <p>If I try:
  var id = $(this).find('td:first').attr('id');
  console.log(&quot;@95 id: &quot;+id);
  I get the an error trying to use the id variable &quot;Uncaught TypeError: id is undefined&quot;</p>
  <p>Without the id variable I can not pull the data needed to populate the dropdown. I'm hoping someone out there can see what I'm missing and help me to solve this issue.</p>