generate random string for div id
<p>i want to display youtube videos on my website but i need to be able to add a unique id for each video thats going to be shared by users. so i put this together and i have run into a little problem. i am trying to get the javascript to add a random string for the div id but its not working showing the string</p>

<pre><code>&lt;script type='text/javascript' src='jwplayer.js'&gt;&lt;/script&gt;
&lt;script type='text/javascript'&gt;
function randomString(length) {
    var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');

    if (! length) {
        length = Math.floor(Math.random() * chars.length);
    }

    var str = '';
    for (var i = 0; i &lt; length; i++) {
        str += chars[Math.floor(Math.random() * chars.length)];
    }
    return str;
}

var div = randomString(8);
&lt;/script&gt;

&lt;div id='div()'&gt;This text will be replaced&lt;/div&gt;

&lt;script type='text/javascript'&gt;
  jwplayer('div()').setup({
    'flashplayer': 'player.swf',
    'file': 'http://www.youtube.com/watch?v=4AX0bi9GXXY',
    'controlbar': 'bottom',
    'width': '470',
    'height': '320'
  });
&lt;/script&gt;
</code></pre>
