某些情況下,<a> 元件被當成像 <button> 元件的控制按鈕,而非預設的連結功能。此時 href 屬性的存在與否會影響滑鼠與鍵盤事件的回應動作。
以下範例以簡單的 jQ .slideToggle() 測試不同情況的<a>對滑鼠與鍵盤事件的回應。
範例
以 jQ 的 .slideToggle() 作為測試
說明
範例中各元件互動回應說明,以 <button> 元件的 click function 作為參照標準
Are you sure to leave this team?
Once you delete your team, all team notes will be deleted and cannot be recovered. Please ensure you've exported or transfered these notes.
Enter team name before deleting it:
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up