+ 2
Border
I can’t change the border of an object at all in JavaScript. var elem = document:getElementById(“example”) elem.style.borderWidth = “10px” elem.style.borderColor = “#FFF” I’ve tried changing it around so many ways and it still didn’t work. (I also tried doing rgba and it didn’t work at all, does it work differently on border?)
5 odpowiedzi
+ 4
what i have seen from your codes.
you have forgotten to add semicolon (;) after every statement
ie.
var elem = document:getElementById(“example”);
elem.style.borderWidth = “10px”;
elem.style.borderColor = “#FFF”;
+ 3
@Norberttony share your complete code 😅.
0
or just do elem.style.border="5px solid black";
kill two birds with a stone
0
I have tried ending every statement with ;
But it still didn’t work...
I tried doing elem.style.border as well, and it didn’t work either.
0
Shoot, now my for statement doesn’t work...
for (a = 1; a <= planets; a++){ //planets is equal to 2
var pl = newplanet() //Generates new planet
alert(a) //Alerts a, output is 201 <—- How is output 201??
game["p" +(a)] = pl //Not important
}