當我看到preventDefault,我發現認定中是'a'標籤的默認操作是什麼?
Event接口的preventDefault()方法告訴用戶代理,如果事件得不到處理,它的默認行爲不應被視爲它通常會。
關鍵詞是:its default action should not be taken as it normally would be
。
當談到a
標籤,我想知道全套的a
元素的默認操作,而不僅僅是click
。
<a href="https://www.google.com/">Go to Google</a>
當我點擊這個文本Go to Google
,我會去Google的主頁。我看過HTML5 specification - the-a-element,沒有找到答案。
_「當我點擊這個文本'Go to Google'時,我會去Google的主頁」_ ---這是'a'元素的默認操作。 – evolutionxbox
你沒看過[規範](https://www.w3.org/TR/html5/text-level-semantics.html#the-a-element)嗎? --- _「創建超級鏈接的元素的激活行爲是運行以下步驟」_... – evolutionxbox
@evolutionxbox,是的。我知道當我點擊它時,它可能是'a'元素的默認動作。但是'touchend'怎麼樣? 'touchend' **時是否有'a'元素的默認動作?我想知道關於'a'元素的所有默認操作。 –