How to set ID using javascript?
<p>I'm generating a page with lot of product, and for this, i need lot of  ID, and i did it using a server side (Python) so i send for every product its own <code>&lt;div id='hello1'&gt; test &lt;/div&gt;</code></p>

<p>Now because the user will dinamycaly set a value and see the result in the browser, i want to generate another <code>ID</code> , to this i've found <code>btoa("hello1")</code> so i generate another <code>ID</code></p>

<p>So the question, how do i put <code>btoa("hello1")</code> in <code>&lt;div&gt;</code> ?</p>

<p>Edit:  what i want to generate is another <code>&lt;div&gt;</code> and not updating the first one.</p>

<pre><code>&lt;input id="{{str(product["avt"]["fto"])}}" &gt; this will become  &lt;input id="12232" &gt; because it is special to Tornado Template
&lt;span&gt;New price :&lt;/span&gt;
&lt;span id=btoa({{str(produit["avt"]["fto"])}})&gt; This  is where i use innerHTML &lt;/span&gt;
</code></pre>

<p>as you can see, the  users will put a value and see it dynamically.</p>

<p>This will work from Python using:</p>

<pre><code>&lt;span id="{{base64.b64encode(str(produit["avt"]["fto"]))}}"&gt;&lt;/span&gt;
</code></pre>

<p>but i if it can be done using Javascript, the server will be free for the half of the operations!</p>
