title: how to get the value of button into other jsp using java script
body: <p>i have to get the button value on other page of jsp and execute <code>&lt;div&gt;</code> tag based upon condition my <code>index.jsp</code> code is this</p>
  
  <pre><code> &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %&gt;
  &lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %&gt;
  &lt;%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %&gt;
  &lt;%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
     function popuponclick()
     {
        my_window = window.open("file.jsp",
         "mywindow","status=1,width=350,height=150");
  
   }
  
  
  
  &lt;/script&gt;
      &lt;/head&gt;
      &lt;table&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;button type="button" onclick="popuponclick()" value="1" name="name"&gt;GetAllEmployeeByID&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;button type="button" onclick="popuponclick()" value="2" name="name"&gt;GetEmployeeByName&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
       &lt;/table&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>and my <code>second.jsp</code> is this</p>
  
  <pre><code>  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%&gt;
  &lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%&gt;
  &lt;%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql"%&gt;
  &lt;%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml"%&gt;
  &lt;%@page import="com.nousinfo.tutorial.employee.service.model.bo.EmployeeBO" %&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
      &lt;title&gt;Insert title here&lt;/title&gt;
      &lt;script&gt;
      function myfuntion(String name)
      { 
          location.
          document.getElementById("div1");
          }
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="/EmployeeWeb/GetEmployee"&gt;
          &lt;div id="div1" style="display: block;"&gt;
                  &lt;table&gt;
                      &lt;tr&gt;
                          &lt;td width="29"&gt;Find_Employee_By_Name:&lt;/td&gt;
                          &lt;td&gt;&lt;input type="text" name="findbyname" /&gt;&lt;/td&gt;
  
  
  &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;input type="submit" name="submit" value="find"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
  
   &lt;div id="div2" style="display: none;"&gt;
                  &lt;table&gt;
                      &lt;tr&gt;
                          &lt;td width="29"&gt;Find_Employee_By_Name:&lt;/td&gt;
                          &lt;td&gt;&lt;input type="text" name="findbyname" /&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;input type="submit" name="submit" value="find"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
              &lt;/div&gt; 
      &lt;/form&gt;
       &lt;button onclick="myfunction()"&gt;&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>how i will get the button value insecond jsp so that based upon condition i can run that <code>&lt;div&gt;</code>  tag part</p>