zhouzhongyuan / qa

Questions recods
MIT License
5 stars 1 forks source link

preventDefault到底prevent了什么? #71

Open zhouzhongyuan opened 7 years ago

zhouzhongyuan commented 7 years ago
zhouzhongyuan commented 7 years ago

.

zhouzhongyuan commented 7 years ago

.

zhouzhongyuan commented 6 years ago

Demo

1. pinch, then enlarge

On Android devices, when pinch out, the page will enlarge.(This is the default action for touchmove)

The example shows the condition with preventDefault and without preventDefault

2. input, check

The check input will be checked or unchecked when clicked.(default action) example

3. What is the default action of a tag?

Clearly, each event potentially has a default action. It may even have different default actions depending on context. You should clarify your question to make it clear that you are looking for the full set of default actions of an a element and not as it reads at the moment, like you are looking for a single default action, which would typically imply that of the click event.