0
Please help me i dont know what im doing wrong
html> body> script> function person(name, age) { this.name = name; this.age = age; this.changeName = function (name) { this.name = name; } } var p = new person("David", 21); p.changeName("John"); //Now p.name equals to "John" /script> /body> /html>
5 Réponses
+ 2
You're using a wrong syntax of html, why? Because instead of <html> you have html> that's the only mistake you have, for html body and script add a < for each markup
+ 1
://hey Gregorio Faerman problem was you were writhing html code in javascript editor, copy html to html and scripts to scripts
https://code.sololearn.com/WHhqk7W4rI60/?ref=app
0
@Juan David Padilla Diaz
I put it and its says "Uncaught SyntaxError: Unexpected token <
Line: 1"
0
Show me your code on playground
0
done