Why should the default behavior of the browser be blocked in the touch event

  node.js, question

图片描述

Why did you add this sentence to the touch event?

Since you are using touch, you must be running on a device that can support touch screen, such as a mobile phone. When you slide on the mobile phone, it has a default scroll screen. Therefore, if you want to operate your dom element and use the touchmove event, it is actually a slide. Originally, your effect was to slide on the dom and produce the corresponding effect. At this time, you certainly don’t want the browser screen on your phone to scroll, so you should disable it by default. Only in this way can there be a good user experience.