Why this link in not working in button tab | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
23rd Jun 2023, 12:43 PM
Sandeep
Sandeep - avatar
7 Answers
+ 5
Sandeep <a href="https://www.sololearn.com/Profile/28763786/?ref=app"><button>Buy normal balloon</button></a>
23rd Jun 2023, 1:12 PM
BroFar
BroFar - avatar
+ 3
You almost got it right! The text for your button should be placed inside the anchor tag, not after the tag has been closed.. Here is the corrected way. <button> <a href="https://www.sololearn.com/Profile/28763786/?ref=app">Buy normal balloon</a> </button>
23rd Jun 2023, 5:16 PM
Chris Coder
Chris Coder - avatar
+ 3
I had this problem before, I realised that you should put the alert inside a function, then call that function onclick of the button.
24th Jun 2023, 12:14 AM
Leeroy Mokua
Leeroy Mokua - avatar
+ 2
BroFar thanks
23rd Jun 2023, 1:18 PM
Sandeep
Sandeep - avatar
23rd Jun 2023, 6:27 PM
Muhammad Saif Arain
Muhammad Saif Arain - avatar
23rd Jun 2023, 12:44 PM
Sandeep
Sandeep - avatar
+ 1
Sololearn compilers, unfortunately, doesn`t allow the users to open some external links, your code have some errors which are mentioned by BroFar and Chris Coder, correct those, and probably try a different link. I have tried <a href="https://www.sololearn.com>Buy normal baloons</a>, and it works, when I clicked on the link, it redirect me to the Sololearn website.
26th Jun 2023, 9:44 AM
Danish Zubair
Danish Zubair - avatar