title: javascript not working (if else )
body: <p>I was following this <a href="http://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_lightbulb" rel="nofollow">tutorial</a> </p>
  
  <p>and I tried to make my own one, but it's not working. This is my code:</p>
  
  <p>the error console</p>
  
  <p>uncaught SyntaxError: Unexpected end of input
  4emoji.html:32 Uncaught ReferenceError: run is not definedonclick @ emoji.html:324emoji.html:32 Uncaught ReferenceError: run is not definedonclick @ emoji.html:3210emoji.html:38 Uncaught ReferenceError: m2 is not definedonclick @ emoji.html:38</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="zh"&gt;
  
  &lt;
  &lt;img id="boy" onclick="run()" src="emoji\walk.png"&gt;
  &lt;br&gt;running boy
  &lt;br&gt;
  &lt;img id="moon" onclick="m()" src="emoji\1.png"&gt;
  &lt;br&gt;moon
  
  &lt;script&gt;
  function run() {
  var image = document.getElementById('boy');
  if (image.src.match("emoji\walk")) {
      image.src = "emoji\run.png";
  } else {
      image.src = "emoji\walk.png";
  }
  }
  function m() {
  var image = document.getElementById('moon');
  if (image.src.match("emoji\1.png")) {
      image.src = "emoji\2.png";
  } else {
  if (image.src.match("emoji\2.png")) {
      image.src = "emoji\3.png";
  } else {
  if (image.src.match("emoji\3.png")) {
      image.src = "emoji\4.png";
  } else {
  if (image.src.match("emoji\4.png")) {
      image.src = "emoji\5.png";
  } else {
  if (image.src.match("emoji\5.png")) {
      image.src = "emoji\6.png";
  } else {
  if (image.src.match("emoji\6.png")) {
      image.src = "emoji\7.png";
  } else {
  if (image.src.match("emoji\7.png")) {
      image.src = "emoji\8.png";
  } else {
  image.src = "emoji\1.png";
  }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I have confirmed the name of the img is correct</p>