I am doing a learn Javascript for beginners course on Scrimba.
We have to create a button. Two different implementations, one using <button type> and the other using <button id> are giving different results.
I am unable to understand what the difference is between type and id. Please help?
Implementation 1 by the tutorial-
<button id="increment-btn">INCREMENT</button>
This gives a red button 1
Implementation 2 by me-
<button type="increment-btn">INCREMENT</button>
This gives a grey button 2
What's the difference between the way they work?
Thanks!