What's wrong with this code(JavaScript, buttons, HTML)? -


<!doctype html> <html> <head>     <title>question 2</title>     <meta http-equiv="x-ua-compatible" content="ie=9"/> </head> <body>     <button onclick="myfunction()">alphabetical order</button>     <button onclick="countfunction">count</button>      <p id="i"></p>     <p id="ii"></p>      <script>         var products = ["printer", "tablet", "router", "keyboard"];         document.getelementbyid("i").innerhtml = products;          function myfunction() {             products.sort();             document.getelementbyid("i").innerhtml = products;         }          function countfunction() {             document.getelementbyid("i").innerhtml = products.length;         }     </script> </body> </html> 

i think it's spelling or formatting error. if can change code little possible while still fixing appreciate lot. if need more details please ask. happy provide information can me.

this son - loves traffic lights!

modify these lines:

<button onclick="myfunction();">alphabetical order</button>  <button onclick="countfunction();">count</button> 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -