Just add an onclick
event to the button
:(只需在button
添加一个onclick
事件:)
<button onclick="location.href = 'www.yoursite.com';" id="myButton" class="float-left submit-button" >Home</button>
But you shouldn't really have it inline like that, instead, put it in a JS block and give the button
an ID:(但是你不应该像这样内联它,而是将它放在一个JS块中并给button
一个ID:)
<button id="myButton" class="float-left submit-button" >Home</button>
<script type="text/javascript">
document.getElementById("myButton").onclick = function () {
location.href = "www.yoursite.com";
};
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…