title: How to add 2 onclick functions
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;h1&gt;A452 Question 2 - Arrays&lt;/h1&gt;
  
  &lt;p&gt;Array of Products:&lt;/p&gt;
  &lt;p id="prod"&gt;&lt;/p&gt;
  &lt;p id="prod2"&gt;&lt;/p&gt;
  &lt;p id="prod3"&gt;&lt;/p&gt;
  &lt;p id="text1"&gt;&lt;/p&gt;
  &lt;p id="text2"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  var products = ["Printer","Tablet","Router","Keyboard","Monitor","Mouse"];
  document.getElementById("prod").innerHTML = products
  &lt;/script&gt;
  
  &lt;button type = "button" onclick = "document.getElementById('prod2').innerHTML = products.sort();"&gt;
  Turn list in alphabetical order!&lt;/button&gt;
  
  &lt;button type = "button" onclick = "document.getElementById('prod3').innerHTML = products.length;"&gt;
  Count the number of items in the list!&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How do I add a string of text before each onclick event.
  For example the output for the second button is "6" while i want it to be "the number of items in the list is: 6"</p>