Skip to main content
added 198 characters in body
Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138

The page is reloading because browser is interpreting it as submit button. Default behaviour of submit button is to refresh. You can use the answer suggested by sfdcfox or can try the following:

You can make the type attribute of your button as "button". Some browsers act like submit if type is not specified.

<button class="btn-enter-panel" onclick="getRemoteName()" type="button">enter <i class="fa fa-long-arrow-right"></i></button>

Always specify the type attribute for a element. Different browsers use different default types for the element.

Src: https://www.w3schools.com/tags/tag_button.asp

You can make the type attribute of your button as "button". Some browsers act like submit if type is not specified.

<button class="btn-enter-panel" onclick="getRemoteName()" type="button">enter <i class="fa fa-long-arrow-right"></i></button>

Always specify the type attribute for a element. Different browsers use different default types for the element.

Src: https://www.w3schools.com/tags/tag_button.asp

The page is reloading because browser is interpreting it as submit button. Default behaviour of submit button is to refresh. You can use the answer suggested by sfdcfox or can try the following:

You can make the type attribute of your button as "button". Some browsers act like submit if type is not specified.

<button class="btn-enter-panel" onclick="getRemoteName()" type="button">enter <i class="fa fa-long-arrow-right"></i></button>

Always specify the type attribute for a element. Different browsers use different default types for the element.

Src: https://www.w3schools.com/tags/tag_button.asp

Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138

You can make the type attribute of your button as "button". Some browsers act like submit if type is not specified.

<button class="btn-enter-panel" onclick="getRemoteName()" type="button">enter <i class="fa fa-long-arrow-right"></i></button>

Always specify the type attribute for a element. Different browsers use different default types for the element.

Src: https://www.w3schools.com/tags/tag_button.asp