title: Javascript/Jquery Using Regex (or not) to add <span> to vowels
body: <p>New to coding and need some help.</p>
  
  <p>Currently my code output numbers from 1-99, it then display some text next to the number depending on the conditions. E.g numbers that are divisible by 3 has 'Java', divisible by 5 has 'Script' and if they are both the it display 'JavaScript'.</p>
  
  <p>My goal now is when a user click on a vowel, it will pop up a number correspondent with the vowel. E.g a = 0, e = 1, i = 2, o = 3 and u = 4. So on the page when some click on any letter a it will have a pop up displaying 0 etc etc.</p>
  
  <p>I've managed to use regex (I believe) to source out the letter a and replace it with 44 to see if it was working. From my research the best solution is putting these vowels into a span and then put a mouseclick on it. I'm not sure how I would do this, how do I find the vowels and put a a/e/i/o/u around it?</p>
  
  <p>Any assistance would be greatly appreciated. Thanks all </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="jquery-1.9.1.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  
  (function() {
  
      function getContent(i, str, match, replaceFn) {
          //find the vowels and wrap them in a span
          //span will have ID or class that we can attach a click handler to.
          var straeiou = "&lt;p&gt;" + i + " &lt;span class='foo'&gt;" + str + "&lt;/span&gt;&lt;/p&gt;";
          var vowela = /a/gi;
          var newvowela = straeiou.replace(vowela, "44");
  
          document.write(newvowela);
  
      }
  
      function num() {
          for (var i=1; i&lt;100; i++) {
  
              if (i%3==0 &amp;&amp; i%5==0) {
                  $('#demo').append(getContent(i, "JavaScript"));
              }
              else if (i%3==0) {
                  $('#demo').append(getContent(i, "Java"));
              }
              else if (i%5==0) {
                  $('#demo').append(getContent(i, "Script"));
              } 
              else {
                  $('#demo').append(getContent(i, ""));
              }
          }
      }
      num();
  
      // $('aeiou').click(function() {
          // alert('clicked');
      // });
  }());
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>