title: Unexpected Number error
body: <p>I have been writing a function to allow users to upload images from their local file system to a website using JavaScript. I have successfully been able to upload images to the browser.</p>
  
  <p>I have also written a function to allow the user to delete these images.</p>
  
  <pre><code>var count = 0;
  function getPhoto(){
  
      var file = document.getElementById('ad_photo');
      var list = document.getElementById('ad_photo_upload');
      var fReader = new FileReader();
      var photo_list = [];
      var counter;
  
      fReader.readAsDataURL(file.files[0]);
      fReader.onloadend = function(event){
  
          counter = count.toString();
  
          list.innerHTML += "&lt;li id = 'pic " + counter + "'&gt;&lt;img src='" + event.target.result + "'&gt;&lt;/img&gt;&lt;a class = 'close' onclick = 'rem_pic(pic " + counter + ")'&gt;X&lt;/a&gt;&lt;/li&gt;"; 
          photo_list[count] = event.target.result;
          count++;
  
      }
  
  
  
  }
  
  function rem_pic(theID){
  
      var element = document.getElementById(theID);
      element.outerHTML = "";
      delete element;
  
  }
  </code></pre>
  
  <p>My issue is whenever I call the "rem_pic(theID)" function I get a Chrome Browser error message that says "Uncaught SyntaxError: Unexpected number". Does anyone have any clue to why this might be? And how I could possibly improve the functions I have written so they work correctly?</p>
  
  <p>Thanks</p>