getElementById with a variable plus an id name
<p>I've almost sussed out this like post function, but one particular thing isn't working. There are multiple posts in the same thread, of course, and so I've assigned the td part the id ".$POST->id."likeunlike, wherein $POST->id calls the post id from a database, using php. This code looks like this:</p>

<pre><code>   &lt;?php 

    echo "&lt;td id=\"likeunlike".$POST-&gt;id."\" style=\"text-align:left\"&gt;...&lt;/td&gt;";

    ?&gt;
</code></pre>

<p>Now, from a javascript function that gets called from within a js file in the page executing the script, I've put in this function:</p>

<pre><code>    function stateChangedlike() 
{ 
if (xmlHttplike.readyState==4 || xmlHttplike.readyState=="complete")
 { 
 var pid = document.getElementById(x).id;
 document.getElementById("likeunlike"+pid).innerHTML=xmlHttplike.responseText;
 } 
}
</code></pre>

<p>Basically I'm trying to make the likeunlike unique to every post on the page, because if i just use the likeunlike with nothing else, all the javascript output goes to the first instance of that likeunlike id. Except now, the function just isn't working...</p>

<p>Basically what I'm wondering is how can I make this javascript function that uses the same basic id for all posts on the same page, work for each post uniquely?</p>

<p>I hope this makes some semblance of sense, otherwise please let me know and I'll try to rephrase it...</p>
