0
Problem with Javascript function
Hi . I made a function in Javascript but i always get a bug . Can you say the problem with my function? Here's the function: function general() { a.style.border = 2px solid red ; a.style.color = "green" ; }
4 Réponses
+ 3
Is variable 'a' declared? U might want to find it using a selector query. Also i am pretty sure the 2px solid red line should be in quotes.
0
Yes the variable is declared.
Yeah sorry i forgot quotes . But anyways i still see a bug
0
Seyyed Abbas Hosseini can u provide more info then? Like an error message or full code?
0
Lemme send you the error message:
Uncaught TypeError : Cannot read properties of null ( reading 'style' )