Uncaught TypeError: Cannot set property of undefined (set 'innerHTML')
P粉0221405762023-11-08 21:06:09
0
1
626
I'm trying to create a webpage using php, on an element of class "Continuous TextBox" (defined by my class), when clicked it has to start a Javascript function which should change the content id of another function" harta-modal" element, but this doesn't happen. I keep getting the same error, "Uncaught TypeError: Cannot set property of undefined (set 'innerHTML')" even though the function is declared after the element it is supposed to change, and the control I wrote within it Taiwan Log This function does not return null. What did i do wrong?
location.href='loginPage.html'"; } ?> Crisis Containment Service
When using
getElementById
to get an element, you do not have to use[0]
to access the first element since it can only return one element.Frommozilla documentation:
So just use: