admin管理员组

文章数量:1205174

I have anchor links which has click event attach to them. When I use tab key to reach the anchor link and press enter, it trigger the click event. I want that it goes to the link attached and does not trigger the click event when pressed enter.

public clickHandler(e: Event) {
    if (this.isMobile) {
      e.preventDefault();
    }
    this.changeState(this.singleItem);
  }
}

本文标签: javascriptPrevent quotEnterquot to trigger onClick event of anchor tagStack Overflow