title: How to access JavaScript variable in HTML tags?
body: <p>I am trying to access JavaScript variable in the <code>href</code> attribute of anchor tag.</p>
  
  <p>JavaScript Function:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
  function fun(ReqTextbox) 
  
  { 
  
  var queueData =document.getElementById(ResTextbox).value; 
  //some more code 
  
  } 
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;body&gt; 
      &lt;input type="text" value="&lt;%=dynamicValue%&gt;" id="&lt;%=dynamicId%&gt;"/&gt; 
      &lt;a href="servlet?variablename="&lt;%Eval(queueData)%&gt;" onclick=fun('&lt;%=dynamicvalue%&gt;');&gt;LINK&lt;/a&gt;     
  &lt;/body&gt; 
  </code></pre>
  
  <p>I know that I am going to wrong at <code>variablename="&lt;%Eval(queueData)%&gt;"</code>.</p>
  
  <p>Can someone please help me how to access and pass JavaScript variable as a query string parameter?</p>