How to pass ID to a JavaScript function
<p>In HTML, I have:</p>

<pre><code>&lt;td&gt;
    &lt;span id="change_naco"&gt;&lt;/span&gt;
    &lt;span id="naco"&gt;Food&lt;/span&gt;
&lt;/td&gt;            
&lt;td&gt;
    &lt;span id="change_naco"&gt;&lt;/span&gt;
    &lt;span id="naco"&gt;apples&lt;/span&gt;
&lt;/td&gt;
</code></pre>

<p>The rows come from the MySQL query. I need to load them in the function:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    EditInPlace.defaults['save_url'] = 'php/save.php?id=150';
    $('naco').editInPlace({
        form_type: 'select',
        select_options: {
            '1':    'food',
            '2':    'apples',
            '3':    'oranges',
            '4':    'beer'
        },
        external_control: 'change_naco'
    });
&lt;/script&gt;
</code></pre>

<p>I know that I must call my ID's differently, so I can do that by adding a number via PHP, for example, <code>change_naco1, change_naco2, change_naco3</code>, and <code>naco1, naco2, naco3</code>, but do I pass those ID names to the function?</p>

<p>It's for edit in place (dropdown menu). It's working fine for one ID, but when I load more lines from the query, it works only for the first one.</p>
