title: How to Pass header tag data when click on selected list in Javascript?
body: <p>There is two list with name=&quot;ABC&quot; in first list and name=&quot;XYZ&quot; in second list.I want to get value of the selected list h4 tag using javascript by calling changefileinput() function?</p>
  <p>For example:
  if I Click on ABC List then I want to get value of its h4 tag i.e First
  if I Click on XYZ List then I want to get value of its h4 tag i.e Second</p>
  <pre><code>    &lt;!-Html Code -&gt;
      &lt;li&gt;
      &lt;a class=&quot;btn templateBtn d-flex mb-2&quot; onclick=&quot;changefileinput(this);&quot;&gt;
       &lt;div class=&quot;ml-2&quot;&gt;
         &lt;h4 data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; name='ABC'&gt;First&lt;/h4&gt;
         &lt;span&gt;List Value-1&lt;/span&gt;
       &lt;/div&gt;
      &lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
      &lt;a class=&quot;btn templateBtn d-flex mb-2&quot; onclick=&quot;changefileinput(this);&quot;&gt;
       &lt;div class=&quot;ml-2&quot;&gt;
         &lt;h4 data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; name='XYZ'&gt;Second&lt;/h4&gt;
         &lt;span&gt;List Value-2&lt;/span&gt;
       &lt;/div&gt;
      &lt;/a&gt;
      &lt;/li&gt;
      
      &lt;!-Javascript Code -&gt;
      function changefileinput(el) {
        alert(&quot;Hello&quot;);
        console.log(&quot;Name of Selected List Element is:&quot;,
          el.name);
      }
  </code></pre>