title: How to populate input text field data based on button pressed
body: <p>In my project i have 10 products for every product i have button called info, if i click on a info button a form popups in that i wanted to fill the first field(product name) automatically ....lets say for product soap i have info button </p>
  
  <pre><code>                  `&lt;a href="" id="1" class="btn"&gt;info&lt;/a&gt;`
  </code></pre>
  
  <p>In the form </p>
  
  <pre><code>               `&lt;form&gt;
              &lt;input type="text" id="product_name"&gt;
             &lt;input type="text" id="number"&gt;
       &lt;/form&gt;`
  </code></pre>
  
  <p>I want the field Product_name to be filled automatically based on button pressed
  so how to get this ..plz help 
  i tried using 
               <code>&lt;a href="" id="1" onClick="reply_click(this.id)"&gt;info&lt;/a&gt;</code>
  and my js </p>
  
  <pre><code>function  reply_click(clicked_id)
  {
  //alert(clicked_id);
   if(clicked_id == "1")
   {
    document.getElementById(product_name).value='Soap';   
   }
   else
   {
   alert("button not pressed");
   }
  
   }
  </code></pre>
  
  <p>i tried this logic for example, i am able to read button click but iam unable to write to form...
  some one please help me out
  Thank you in advance</p>