How to create a HTML Cancel button that redirects to a URL

前端 未结 11 1173
Happy的楠姐
Happy的楠姐 2020-12-13 13:00

I am playing with the Buttons in the w3schools Tryit editor, and I am trying to figure out how to make my browser redirect to an URL when I click on the \"Cancel\" button.

11条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 14:01

    Just put type="button"

    
    

    Because your button is inside a form it is taking default value as submit and type="cancel" doesn't exist.

提交回复
热议问题