Skip to content
Advertisement

My Page is automatically Reloading when I click the dropdown button

I’m just a newbie in javascript, I’m using a multiline forms and I can’t find the reason why my page is reloading when I click the dropdown button and it keeps getting back on the first page of my form.

here is my code in the dropdown

JavaScript

here is the javascript:

JavaScript

Advertisement

Answer

First remove href property from button tags.

href is a property of a tag.

and if you want to cancel event of button add this to your code event.preventDefault()

here an example:

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