Skip to content
Advertisement

Change var value from dropdown in javascript with onchange

I have a dropdown list which looks like this:

JavaScript

And my code to get the value is:

JavaScript

The value always chooses the first item. How can I get it to accept the cityID and change the page,

I’m sure its a formatting or typo or wrong value ?

Advertisement

Answer

You could achieve this using addEventListener also.

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