kragor kragor - 1 year ago 91
HTML Question

syntax error: missing ) after the arguement list?

<button id="btn" onclick="download(http://imageurl) value ="download"><button>

function download(url){
var link = document.createElement('a');
link.href = url; = "image.jpg";

Synatx error ) missing after the arguement list?

Answer Source

You are missing quotes in the HTML. Both the close " for the onclick attribute, and you need to wrap your parameter in single quotes to make it a string:

<button id="btn" onclick="download('http://imageurl')" value ="download"><button>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download