title: JavaScript Uncaught SyntaxError: Unexpected end of input
body: <p>I have some error like </p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Unexpected end of input</p>
  </blockquote>
  
  <p>I have error when i put some parameter in function, my code like this</p>
  
  <pre><code>var now = "2018-04-17 11:10:20";
  var div = document.createElement("div");
  var element = document.getElementById("box");
  element.appendChild(div);
  div.setAttribute("id", "card"); 
  div.setAttribute("onclick", "democlick(", now, ")"); 
  var img = document.createElement("img");
  var para = document.createElement("p");
  var isi = document.createTextNode(datetime);
  para.appendChild(isi);
  var element_div = document.getElementById("card");
  element_div.appendChild(img);
  element_div.appendChild(para);
  img.setAttribute("src", "markermotor.png");
  
  function democlick(a){
      var now = a;
      console.log(now);
  }
  </code></pre>
  
  <p>Please tell me what wrong with this code ?
  Thanks</p>