Is there a way to get a <button> element to link to a location without wrapping it in an <a

后端 未结 8 1986
礼貌的吻别
礼貌的吻别 2020-12-02 06:49

Just wondering if there is a way to get a HTML

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 07:17

    Inline Javascript:

    
    

    Defining a function in Javascript:

    
    
    

    or in Jquery

    
    
    $('#some_id').click(function() {
      window.location='http://www.example.com';
    });
    

提交回复
热议问题