i want a anchor should act like and input type submit button

后端 未结 5 1863
忘掉有多难
忘掉有多难 2020-12-18 05:17

i want a anchor should act like and input type submit button. i am using a jquery plugin library that actually uses input type submit but i have styled my buttons on anchors

5条回答
  •  我在风中等你
    2020-12-18 05:37

    
    

    now you can use jquery to add an event handler

    $('#anchor').click(function (e) {
      // do some work
    
     // prevent the default anchor behaviour
     e.preventDefault();
    })
    

    now you can style your anchor as you wish and it will act as a regular button

提交回复
热议问题