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

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

Just wondering if there is a way to get a HTML

8条回答
  •  情歌与酒
    2020-12-02 07:30

    Here it is using jQuery. See it in action at http://jsfiddle.net/sQnSZ/

    
    
    $('#x').click(function(){
        location.href='http://cnn.com'
    })
    

提交回复
热议问题