javascript - Unexpected Token Var -
i have error unexpected token var. searched no answer question. code there error: note: not full code , part error is. @ line 2.
function firstpart() { var chin = document.getelementbyid('dialog'); var name = document.getelementbyid('textf').value;
in javascript, syntax function is:
function functionname() { //lines of code }
the code have provided here missing the closing curly brace (}).
add closing curly brace , see happens.
as code itself, there nothing wrong it.
it works correctly when closing curly brace added it.
you can see here: http://jsfiddle.net/uaysk/1/
hope helps.
Comments
Post a Comment