assigning dynamically to document.getElementById from an array string
<pre><code>var urlName=new Array("total","pub");
var query = window.location.search.substring(1);

for (var i=0;i&lt;vars.length;i++) {
    document.getElementById("'"+urlName[i]+"'").innerHTML = pair[i];
}
</code></pre>

<p>How can I assign UrlNames dynamically?</p>
