A Tag active Attribute
Can I toggle the 'active' status of an element to invoke css 开发者_开发百科a:active
properties?
If you hold your mouse down on the anchor element (or any element), it will invoke the active property. If you want to do this dynamically (in JavaScript), you can create a class, a.active
, and add/remove "active"
from the className property on the dom element.
精彩评论