title: JQuery: Find (the index of) a row with a specific data attribute value
body: <p>I am trying to append a string, myoutput, right after a specific row in a table similar to this one: </p>
  
  <pre><code>&lt;table&gt;
  &lt;tr data-my_id='1'&gt; &lt;td&gt; content &lt;/td&gt; &lt;/tr&gt;
  &lt;tr data-my_id='2' data-my_other_id='1' &gt; &lt;td&gt; content &lt;/td&gt; &lt;/tr&gt;
  &lt;tr data-my_id='3' data-my_other_id='2' &gt; &lt;td&gt; content &lt;/td&gt; &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>So let's say I want to append my output string after the tr with <code>data-my_other_id='2'</code>
  (note that in my code, <code>my_other_id = 2</code> already )</p>
  
  <p>I am trying to accomplish it doing this:</p>
  
  <pre><code>var want = $("tr").find("[data-my_other_id='" + my_other_id + "']").index();
  </code></pre>
  
  <p>after finding the index, I want to append my output strhing to this row...</p>
  
  <pre><code>$(want).insertAfter(...?);
  </code></pre>
  
  <p>Also... I noticed whenever I do</p>
  
  <pre><code>alert( want = $("tr").find("[data-my_other_id='" + my_other_id + "']").length)
  </code></pre>
  
  <p>I get 0 ... </p>
  
  <p>Help please and let me know if my question is not clear enough so I can explain better. </p>