<form name="myForm" method="post">         
  <textarea id="commentarea"></textarea>         
  <input type="text" name="locate" value="<%=rs.getString("location")%>">         
  <input type="button" value="View Comment" onclick="getComment()">     

function getComment(){   
  <% String locate=request.getParameter("locate"); %>   
  var location = "<%= locate%>";   
  document.getElementById('commentarea').value = location; 

I know this is the worst way to access it, but i need to access it in this way.
I want want the value of <%=rs.getString("location")%> to be the value of var location(in the javascript), i always get null, what should i do?