javascript - button href not working - Stack Overflow

<a href="signUp.html"><button type="submit" class="btn btn-primary su

<a href="signUp.html"><button type="submit" class="btn btn-primary submitSignUp" >Sign Up</button></a>

Why does this not work? I have a different page called signUp and on-click of the sign-up button, I want it to go to the signUp page.

<a href="signUp.html"><button type="submit" class="btn btn-primary submitSignUp" >Sign Up</button></a>

Why does this not work? I have a different page called signUp and on-click of the sign-up button, I want it to go to the signUp page.

Share Improve this question asked Apr 8, 2017 at 22:31 UZAIR VAWDAUZAIR VAWDA 131 silver badge4 bronze badges 6
  • what error are you seeing? – hackerrdave Commented Apr 8, 2017 at 22:32
  • If you want your a tag to look like a button you must use CSS. a tag like button with CSS more ways to do it – Memristor Commented Apr 8, 2017 at 22:38
  • Look the following link: a tag like button – Memristor Commented Apr 8, 2017 at 22:39
  • Look the following link: a tag like button – Memristor Commented Apr 8, 2017 at 22:40
  • Give a try to the following link: a tag like button – Memristor Commented Apr 8, 2017 at 22:42
 |  Show 1 more ment

2 Answers 2

Reset to default 6

You should not place <button> inside <a> element as <button> consumes mouse events preventing <a> element click generation.

So try just this

<a href="signUp.html" class="btn btn-primary submitSignUp">Sign Up</a>

to have the same result I would suggest you to change your code to this:

<a class="btn btn-primary submitSignUp" href="signUp.html">Sign Up</a>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745105833a4611550.html

相关推荐

  • javascript - button href not working - Stack Overflow

    <a href="signUp.html"><button type="submit" class="btn btn-primary su

    6小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信