a tag pointer-events

After a label is also rendered to the page, for some reason need to disable.

There are two ways you can set to disable the effect.

1, using CSS attribute pointer-events, this property is set after none, the element will not be a target mouse events.

This property has a drawback, that is, after then set cursor: pointer, not-allowed, and so will no longer work. After all, the element i will never be the target of a mouse event.

Note: However, when elements of their offspringpointer-eventswhen property values specify other mouse events can point descendant elements, in this case, the mouse events will trigger an event listener parent element in the capture or bubbling phase.

mdn detailed explanation

2, the href attribute is set or javascript :; #. At this time, cleared away the label of a link, there can be no jump up.

Guess you like

Origin www.cnblogs.com/xguoz/p/11718586.html