Don't use <div> to create buttons.use <a>, <button> or <input type=button> instead

I think codecademy is teaching us wrong.

Stackoverflow: Not to use div for button functionality

Stackoverflow: Making buttons - button or div?

No, it is not wrong. We purely use the div to decorate the button, the actual clicking part of the button is the link. Which is valid.

The problem here is that if we want to use one of those methods, more explanations is required. At certain point choices need to be made, you can put everything in a course.

Because of the knowledge people have when they are new to programming (i don’t mean this negative, everyone started from nothing some day) this is okay practice.

But good you shared this for the people who are interested in this

1 Like