title: problematic javascript array?
body: <p>I'm having problem with my javascript. When running as a html functions of the buttons do not work. </p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;p&gt;Click the button to sort the array.&lt;/p&gt;
  &lt;button id=“buttonOne” onclick=“myFuntion()”&gt;Try it&lt;/button&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  &lt;button id = “ButtonTwo” onclick=“myFunction()”&gt;Count the Number of products!&lt;/button&gt;
  
  &lt;p id=‘demo2”&gt;&lt;/p&gt;
  </code></pre>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre><code>var fruits = ["apple", "banana", "mango", "orange","avocado"];
  document.getElementById("demo").innerHTML = fruits;
  
  var buttonOne = document.getElementById("buttonOne");
  var buttonTwo = document.getElementById("buttonTwo");
  
  buttonOne.addEventListener("click", function() {
      fruits = fruits.sort();
      document.getElementById("demo").innerHTML = fruits;
  });
  
  buttonTwo.addEventListener("click", function() {
      length = fruits.length;
      document.getElementById("demo2").innerHTML = length;
  });
  </code></pre>
  
  <p>If someone could take a look at this and perhaps suggest what is wrong with it?</p>