use string to search json
<p>I have:</p>

<pre><code>var id = 1;
console.log(myJSON.users[id].name);
</code></pre>

<p>This outputs "Tom"</p>

<p>I want to output the same with:</p>

<pre><code>var id = 1;
var attr = "name"
console.log(myJSON.users[id].attr);
</code></pre>

<p>Now, jQuery is searching for "attr" instead of the string inside attr. How can I do this?</p>
