title: Javascript & jquery | I want to get the text in the <span> tag outside the button the user clicked on
body: <p><a href="https://i.stack.imgur.com/ezUMI.png" rel="nofollow noreferrer">Web site picture</a></p>
  <p>Hello I want to get a val in span with on click event but <strong>I must use one event for this.</strong></p>
  <p>What am I trying to do basicly if user click PAY button inside in second div I should get</p>
  <p>.faturatarih value witch is &quot;09-05-2021 10:22&quot; in second div but</p>
  <p>if user click PAY button in first div I should get &quot;09-05-2021 08:22&quot;</p>
  <p>sorry for my bad english</p>
  <p>Here is my HTML code</p>
  <pre><code>&lt;div class=&quot;fatura&quot;&gt;
      &lt;span class=&quot;faturaTarih&quot;&gt;09-05-2021 08:22&lt;/span&gt;
      &lt;button type=&quot;button&quot; class=&quot;faturaOdeButton&quot;&gt;PAY&lt;/button&gt;
      &lt;p class=&quot;faturaGonderenIsım&quot;&gt;Mr. Jack&lt;/p&gt;
      &lt;span class=&quot;faturaAciklama&quot;&gt;Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quae, minus provident.&lt;/span&gt;
      &lt;span class=&quot;faturaDurum&quot;&gt;Waiting&lt;/span&gt;&lt;span class=&quot;faturaUcret&quot;&gt;$500,00&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;fatura&quot;&gt;
      &lt;span class=&quot;faturaTarih&quot;&gt;09-05-2021 10:22&lt;/span&gt;
      &lt;button type=&quot;button&quot; class=&quot;faturaOdeButton&quot;&gt;PAY&lt;/button&gt;
      &lt;p class=&quot;faturaGonderenIsım&quot;&gt;Mr. Tom&lt;/p&gt;
      &lt;span class=&quot;faturaAciklama&quot;&gt;Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quae, minus provident.&lt;/span&gt;
      &lt;span class=&quot;faturaDurum&quot;&gt;Waiting&lt;/span&gt;&lt;span class=&quot;faturaUcret&quot;&gt;$1000,00&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>