title: how to display id of input field with respective those value
body: <p>I have multiple forms like shown below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function chartsubmitbtn() {
    var x = $('#x_axis_t1').val();
    alert(x);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  
  &lt;div id="trace-div1"&gt;
    &lt;h4&gt;&lt;b&gt;Trace 1 &lt;/b&gt;&lt;/h4&gt;
    &lt;form&gt;
      &lt;table&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;label&gt;X Axis:  &lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="t1_x_axis" id="x_axis_t1" size="50"&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;label&gt;Y Axis:  &lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="t1_y_axis" id="y_axis_t1" size="50"&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;div id="trace-div2"&gt;
    &lt;h4&gt;&lt;b&gt;Trace 2 &lt;/b&gt;&lt;/h4&gt;
    &lt;form&gt;
      &lt;table&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;label&gt;X Axis:  &lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="t1_x_axis" id="x_axis_t2" size="50"&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;label&gt;Y Axis:  &lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="t1_y_axis" id="y_axis_t2" size="50"&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;button type="button" id="chart-report-submit" onclick="chartsubmitbtn();"&gt;Submit&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>in above code if i click the submit button it will display values with respect there id  .</p>
  
  <p>my expected out put is </p>
  
  <pre><code>x_axis_t1 = "x axis t1";
  y_axis_t1 = "y axis t1";
  x_axis_t2 = "x axis t2";
  y_axis_t2 = "y axis t2";
  </code></pre>
  
  <p>in above <code>x_axis_t1,x_axis_t1,x_axis_t1</code> and <code>x_axis_t1</code> are IDs with respect there input text values.</p>