How to pass id from button to modal
<pre><code>&lt;div class="panel panel-default"&gt;
  &lt;div id="view_query"&gt;
    &lt;div class="panel-heading"&gt;
      &lt;h3 class="panel-title"&gt;Reply Query&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="panel-body"&gt;
      &lt;div class="table-responsive"&gt;
        &lt;table class="table table-hover table-bordered" id="example-1"&gt;
          &lt;thead&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;th&gt;Title&lt;/th&gt;
            &lt;th class="no-sorting"&gt;Description&lt;/th&gt;
            &lt;th class="no-sorting"&gt;Photo&lt;/th&gt;
            &lt;th class="no-sorting"&gt;Date&lt;/th&gt;
            &lt;th class="no-sorting"&gt;Actions&lt;/th&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
            &lt;?php for($i=1;$i&lt;=12;$i++){?&gt;
            &lt;tr&gt;
              &lt;td&gt;'NAME'&lt;/td&gt;
              &lt;td&gt;'Title'&lt;/td&gt;
              &lt;td&gt;'Description'&lt;/td&gt;
              &lt;td&gt;
                &lt;img src="" height="80px" width="100px"&gt;
              &lt;/td&gt;
              &lt;td&gt;'dd/mm/yyyy'&lt;/td&gt;
              &lt;td class="action"&gt;
                &lt;input type="submit" value="&amp;#xf112;&amp;nbsp;&amp;nbsp;&amp;nbsp;Reply" href="javascript:;" onclick="jQuery('#modal-6').modal('show', {backdrop: 'static'});" style="background-color: #313437;border:1px solid #313437" class="btn btn-primary btn-single btn-sm fa-input"&gt;
                &lt;input type="text" hidden="" value="&lt;?php echo $i;?&gt;" name="id"&gt;
                &lt;/input&gt;
              &lt;/td&gt;
              &lt;?php }?&gt;
            &lt;/tr&gt;
            &lt;!-- &lt;form method="post" action=""&gt;
                                    &lt;button name="submit" id="btn_reply" class="btn btn-dark btn_add_record form-control text-left fa-input" value="&amp;#xf112;&amp;nbsp;&amp;nbsp;&amp;nbsp;Reply" style="color:#fff" type="submit"&gt;&lt;/button&gt;
                                    &lt;input type="text" hidden="" value="&lt;?php echo $i;?&gt;" name="id"&gt;
                                &lt;/form&gt; --&gt;
            &lt;!-- &lt;a href="index.php?p=query&amp;id= &lt;?php echo $i;?&gt;" id="btn_reply" class="btn btn-primary btn_add_record "&gt;&lt;i class="fa fa-reply"&gt;&lt;/i&gt; Reply&lt;/a&gt; --&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>This is my code of view data.when user click on reply button, i want to display modal.it displayed it but which button is clicked how i know?
i want to pass id to identified it so please help me how to pass it.</p>

<pre><code>&lt;div class="modal fade validate" id="modal-6"&gt;
    &lt;div class="modal-dialog"&gt;
        &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
                &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                &lt;h4 class="modal-title"&gt;Reply Query&lt;/h4&gt; 
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                &lt;div class="row"&gt;
                    &lt;div class="form-group col-md-6"&gt;
                        &lt;label class="control-label"&gt;Title&lt;/label&gt;
                            &lt;input class="form-control" disabled="" name="question" data-validate="required" data-message-required="Please Enter Title" placeholder="Enter Title" type="text"&gt;
                    &lt;/div&gt;
                    &lt;div class="form-group col-md-6"&gt;
                        &lt;label class="control-label"&gt;URL&lt;/label&gt;
                        &lt;input class="form-control" name="url" disabled="" data-validate="required" data-message-required="Please Enter URL"  placeholder="Enter URL" type="text"&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="row"&gt;
                    &lt;div class="col-md-12"&gt;
                        &lt;div class="form-group no-margin"&gt;
                            &lt;label for="description" class="control-label"&gt;Description&lt;/label&gt;
                            &lt;textarea class="form-control autogrow" id="description" placeholder="Describe Description Regarding Query"&gt;&lt;/textarea&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="row"&gt;
                    &lt;div class="form-group col-md-6"&gt;
                        &lt;label class="control-label"&gt;Image Upload&lt;/label&gt;
                        &lt;div&gt;
                            &lt;div class="fileinput fileinput-new" data-provides="fileinput"&gt;
                                &lt;div class="fileinput-new thumbnail" style="width: 200px; height: 150px;" data-trigger="fileinput"&gt; &lt;img src="http://placehold.it/200x150" alt="..."&gt; &lt;/div&gt;
                                &lt;div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px"&gt;&lt;/div&gt;
                                &lt;div&gt; &lt;span class="btn btn-white btn-file"&gt; &lt;span class="fileinput-new"&gt;Select image&lt;/span&gt; &lt;span class="fileinput-exists"&gt;Change&lt;/span&gt;
                                    &lt;input type="file" name="..." accept="image/*"&gt; &lt;/span&gt; &lt;a href="#" class="btn btn-orange fileinput-exists" data-dismiss="fileinput"&gt;Remove&lt;/a&gt; &lt;/div&gt;
                            &lt;/div&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-info"&gt;Send&lt;/button&gt;
                &lt;button type="button" class="btn btn-white" data-dismiss="modal"&gt;Close&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt; 
</code></pre>

<p>This is the code of modal.</p>