+ 2
Here the full example:
https://sololearn.com/compiler-playground/WHlxLVey5kJy/?ref=app
+ 4
First you cannot call a function with dot.
Second you access a collection.
Third the called name of class is incorrect.
This works:
var p = 0;
var ps = 1;
function Add(x){
p+=ps;
document.getElementsByClassName("p"+x)[0].innerText = p
}
+ 3
Firstly, remember that with Sololearn's compiler you need to wrap your JavaScript tab in the window.onload function.
Maybe looking at this code might help you find some of your other errors:
https://code.sololearn.com/WmW291DVWMP8/?ref=app
+ 1
The Smart One
You are welcome!