Select a table row base on the content of a custom attribute
<p>So I have a table with multiple rows. the first TD of each row content a custom attribute tag called lineup. Ex:</p>

<pre><code>&lt;td lineup="['463', '442', '200', '97', '238', '548', '166', '184', '353', '26', '573']"&gt;Some stuff&lt;/td&gt; 
</code></pre>

<p>This is actually a list I pass into the html through Jinja2. I figured it was the best solution to store this data. Maybe I'm wrong, I'm just starting to code.</p>

<p>Now what I want to do is select the row when the lineup contain a specific ID.</p>

<p>Right now I'm doing it like so:</p>

<pre><code>$("#xtable tbody td[lineup*='"+ID+"'']").parent()
</code></pre>

<p>Which work great except if the ID is 63, it will also select the row with the id 463. I understand why it is doing this since it's basically searching a string, he doesn't know that 463 is actually not 63.</p>

<p>So my questions:</p>

<ul>
<li>Is there a better way to store the data in the html / js ?</li>
<li>Using regex ( which I don't know how to use ) can I make it find only
63 and not 463 for example?</li>
</ul>

<p><strong>EDIT:</strong></p>

<p>This is my Jquery function:</p>

<pre><code>$('#update li').hover(function(){
        playerId = $(this).find('span').attr("pid");
        $("#xtable tbody td[lineup*='"+playerId+"'']").parent().css("background-color","#d9edf7")
        },
        function(){
            $("#xtable tbody td[lineup*='"+playerId+"'']").parent().css("background-color","")
});
</code></pre>

<p>Example of a li element to get the playedId</p>

<pre><code>&lt;li class="pushmsg" style=""&gt;&lt;p&gt;&lt;span rel="tooltip" class="player-name" pid="14" data-original-title="total point: 3"&gt;Arshavin&lt;/span&gt; just got an assist&lt;/p&gt;&lt;/li&gt;
</code></pre>

<p>Thanks!</p>
