Could you tell me how to add the red underline when clicking the mouse?

http://wap.8288888.cn/2018424/ wants to achieve such an effect

solve

Mar.05,2021

  tabArr:['',''],
  active:0,

 click(index){
     this.active = index
       },
   active

Code
document


the easiest way is to get the tag to click in js, and add the css attribute 'text-decoration: underline', underline color to the color attribute after triggering the click event.
refer to CSS text-decoration attribute

Menu