Uncaught TypeError: Cannot read property 'getAttribute' of null
The error line is shown in the third line of this code.
Code
vara=param.getAttribute("a");
varb = document.getElementById(a);
varc_class = b.getAttribute("class");
I am using jquery.
I wonder what it is because only certain users have errors.
What does this mean?
Is it correct that the contents of the getAttribute function in the third line are null?
I modified the code a little, but it looks like this.
javascript jquery
In the first line, getAttribute("a") is trying to retrieve the value of the "a" attribute, although it is unclear what param is.If param is an element, does the a attribute exist?
If it does not exist, it returns null, so it seems that there is no attribute itself.
© 2024 OneMinuteCode. All rights reserved.