title: How can I add ajax get call to a html element?
body: <p>So I am trying to run a js code that turns all of <code>&lt;a&gt;&lt;/a&gt;</code> elements under another element <code>&lt;b&gt;&lt;/b&gt;</code> (the actual name is unique in the HTML) to a link that makes an HTTP get request. This is what I got and it doesn't do anything.</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>$("b a").each(function(index, element) {
    var data = element.getAttribute("data-something");
    // $.ajax("https://example.com/" + data);
    console.log(data);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;b data-something="an-id" class="missing"&gt;has has not been installed. to see more click on&lt;a&gt;Link&lt;/a&gt;&lt;/b&gt;</code></pre>
  </div>
  </div>
  </p>