title: Javascript - Passing pre-defined value
body: <p>My function in HTML file is:</p>
  
  <pre><code>&lt;p onclick='geturl('http://widefide.com/feed')'&gt; Click Me! &lt;/p&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  </code></pre>
  
  <p>Now what should be my javascript function to pass that url (i.e. <a href="http://widefide.com/feed" rel="nofollow">http://widefide.com/feed</a>) to "demo"? Like this? :</p>
  
  <pre><code>function geturl(ok)
  {
     document.getElementById("demo").innerHTML = ok;
  }
  </code></pre>
  
  <p>This is returning this error: "`Uncaught SyntaxError: Unexpected token } "
  Is this because thar <p> element is getting url from PHP+MYSQL? For instance:</p>
  
  <pre><code>print("&lt;p onclick='geturl('" . $title["url"] . "')'&gt;Click Me!&lt;/p&gt;
  </code></pre>