title: How to change text every 5 seconds
body: <p>I have a line of text, with a span. I wanted to the text in span change every 5seconds.
  I made a script :</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>var texts = new Array();
  texts.push("Text1");
  texts.push("Text2");
  texts.push("Text3");
  
  var point = 0;
  
  function changeText(){
    $('#cookie-alert .col h3 span').html(texts[point]);
    if(point &lt; texts.length){
      point ++;
    }else{
      point = 0;
    }
    setInterval("changeText", 5000)
  }
  
  changeText();</code></pre>
  </div>
  </div>
  </p>
  
  <p>So the array contains all the texts.
  So with this, the first text appears but not others.
  I have an error:</p>
  
  <blockquote>
    <p>"ReferenceError: changeText is not defined" at line "setInterval("changeText", 5000)"</p>
  </blockquote>
  
  <p>I don't understand where is my mistake</p>