How to link to a pill?


Topic: How to link to a pill?

PerfectCamp pro premium priority asked a year ago

In the MDB Design blocks there is a Login / Register example. On the Login content there is a Register text link toward the bottom. Clicking on this text link doesn't do anything. I'm trying to hook it up to show the Register pill content.

Is there a quick way to have this link open the Register pill?

Resources (screenshots, code snippets etc.) enter image description here


kpienkowska staff answered a year ago

Add ID to register link and add this JS code:

const tab = document.querySelector('#tab-register')
const instance = mdb.Tab.getInstance(tab)

const link = document.querySelector('#register-link')
link.addEventListener('click', ()=> instance.show())

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.0
  • Device: PC
  • Browser: Chrome
  • OS: Win 11
  • Provided sample code: No
  • Provided link: Yes
Tags