How does the "Follow" button changes the label after click?

rafas_10
Tera Guru

Hi guys, I am trying to replicate the functionality of the "Follow" button, meaning that when you click the "Follow" button it changes the label to "Following", when you hover it after it changes to "Following", it appears "Unfollow", and when you click "Following" it turns back on to "Follow".

 

How do I replicate this type of label changes after click?

 

Thanks for the help!!

3 REPLIES 3

mihirlimje867
Tera Guru

Hello @rafas_10 ,
You can achieve this configuration using the HTML and javascript functions like onClick(), onhover() and onChange().

Please refer this site: https://www.geeksforgeeks.org/how-to-change-the-button-label-when-clicked-using-javascript/

Thank you.

Hi @mihirlimje867 ,

But where is this defined for the 'Follow' button since it's a UI action?

Hello @rafas_10 ,
You can open the UI Action table and open this UI Action and check the script part you will definetly find something over there.

Thank you.