0
Plese help me with this javascript code.
3 Respuestas
+ 5
The problem is that, the 'name' is a reserved word in JavaScript and that's the reason it is showing error.
However, if you still want to use 'name' as your function name, you can try changing the first word into capital, i.e. 'Name' it would definitely work.
i.e.,
HTML
<button onclick = "Name()">Click me</button>
JavaScript
Function Name(){
document.write("namaste");
}
+ 2
Thanks Krishna for the help.