Skip to content
Advertisement

The value of my variable is changing In another file

I got this varible:

JavaScript

My problem is that the user can change the value in #box. So it contains x different li:s then my var things is not set anymore. How do I change this var? var things is in my index.php file. The place where the user changes the #box is in my change.php file, so I think It’s a bit harder.

Probably I duplicate but I dont know what to search so please direct me if you can.

Advertisement

Answer

Use getElementsByTagName, which will return a live HTMLCollection, which you can select again:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement