Skip to content
Advertisement

change page HTML after change dropdown

I have 2 pages and the main page. the total 3 pages. I want to access the first and second pages after changing the dropdown list. I try this code by Jquery in my HTML called main.html.

JavaScript

I want to use the if statement.

If select 1 load firstPage.html

If select 2 load secondtPage.html

Any Edition of this code.

Advertisement

Answer

Please note that values and file names are case sensitive, so ‘firstpage’ and ‘firstPage’ are not the same!

Try this jQuery code:

JavaScript

Don’t do things like this as it may be unsafe:

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