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
3 Respuestas
+ 2
Try this
<button onclick="window.open('https://youtu.be/dQw4w9WgXcQ?feature=shared', '_blank')">Click me</button>
+ 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
0
Thanks 💫As💫 and Afnan Irtesum Chowdhury , now I improved the code