Get an element's value without an id
<p>I've got following HTML:</p>

<pre><code>&lt;span class="testClass1" &gt;
  &lt;a href="testlink.com"&gt;wanted Text&lt;/a&gt;
  &lt;a class="ctx" href="#"&gt;&lt;/a&gt;
&lt;/span&gt;
</code></pre>

<p>Now I want to get the text <code>"wanted Text"</code>.
How can I achieve this?</p>

<p>I tried with:</p>

<pre><code>document.getElementsByClassName("testClass1");
</code></pre>

<p>I also tried with <code>document.getElementsByTagName()</code> but I don't know how to use them properly.</p>