title: how to pass string parameter in onclick function
body: <p>Here is my jsp code</p>
  
  
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function updatestatus(str){
      //window.location.href="updatestatus.jsp?cid="+str;
      alert(str);
  }
  function deletecompany(str1){
      alert(str1)
      //window.location.href="deletecompany.jsp?cid="+str1;
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;%
  String status=request.getParameter("status");
  //String id=request.getParameter("id");
  String id="0005";
  out.println(id);
  if(status.equals("approve")){
      out.println("&lt;input type='button' value='update' onclick='updatestatus(\""+id+"\")'/&gt;");
  }else if(status.equals("reject")){
      out.println("&lt;input type='button' value='delete' onclick='deletecompany(id)'/&gt;");
  }
  %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I can get two types of button, but there is no response when I click. I have tried many parameter formats within the function bracket, they all don't work...I wonder what is the problem, would you give me some advice?</p>
  
  <p>Thank you for your attention
  best regards ;</p>