I need to make all this divs into buttons, here is my full code:
<div class="mc-button full">
<div type="button" class="title">1.19.3</div>
</div>
I tried add this
<div class="mc-button full">
<div type="button" href="about1-19-3.html" class="title">1.19.3</div>
</div>`
But it doesn’t work.
3
Answers
This should be converted into something like this…
Or something like this…
You mix a lot of different things here.
A button is a trigger to fire a script.
You use this in combination with either
onclick
attribute or directly in JS with anaddEventListener
to fire a script.A link connects another resource to your document.
That connects another resource such as CSS, Favicons to your document.
An anchor directs to another resource.
that if clickd, will redirect you to another resource by either changing the current tab, opening a new tab or by downloading another resource.
A div is just an unspecific block-level container. If you want to use
href
to re-direct do another element you either want to use an anchor or you need JS to add an eventListener to redirect. Markup valid-wise you should use JS:However, with only
1.19.3
as content it mostlikely should be an anchor:why for any reason would you turn a div into a button?
suprise, you also can’t add a type attribute to a div.
But if you insist, Here is your answer: