title: Change icon with javascript
body: <p>In my foray into web development I have found a new problem, I need to change the icon for another one when I click on it. I have an idea of a function in javascript that sends the id of the icon and with the obtain the element, after obtaining element I hope to change keyboard_arrow_up by keyboard_arrow_down. However that is the part that is not performed, how do I get the value keyboard_arrow_up?</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>function change(iconID) {
      var item = document.getElementById(iconID);
      if (item) {}
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;i id="icon1" onclick="change('icon1')" class="material-icons"&gt;keyboard_arrow_up&lt;/i&gt;</code></pre>
  </div>
  </div>
  </p>