0

Button-link

How to make my button as a link, I tried with <div> and some css to create a box but if I click inside the box ,outside the link text there's no function... https://sololearn.com/compiler-playground/WwOSYxj7vI1D/?ref=app

31st May 2025, 1:10 PM
RORONOA ZORO
RORONOA ZORO - avatar
3 Respuestas
+ 2
Try this <button onclick="window.open('https://youtu.be/dQw4w9WgXcQ?feature=shared', '_blank')">Click me</button>
31st May 2025, 2:25 PM
💫As💫
+ 2
RORONOA ZORO You could nest the button inside the anchor tag, instead of the opposite that you did in your code. <a href="yourlink.com"><button>click me</button></a> then if you need the text to be styled like normal links(blue-colored and underlined) then you can use CSS. but this could cause unexpected behaviors, as well as the fact that it violates HTML specifications. so you could also use js(onclick) as 💫As💫 suggested
31st May 2025, 3:55 PM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar
0
Thanks 💫As💫 and Afnan Irtesum Chowdhury , now I improved the code
1st Jun 2025, 7:34 AM
RORONOA ZORO
RORONOA ZORO - avatar
OSZAR »