We can create button using <button>
tag. like this
<button> Log In </button>
We can set this up as hyperlink , to do that cover button with <a>
tag.
<a href="login.html">
<button> Log In </button>
</a>
We can create disabled button by adding disabled
inside opening tag
We can Customise Button Appearance by adding some CSS to <button>
opening tag
<button style="background-color: black;color: white; border-radius:5px">Log In</button>
Output :
background-color
. - used to change background colour of the button
color
: This colour defines the font colour
border-radies
: using this css property we can round edges in button to make it stylish
This button just by using HTML , but we can do more using button like execute some commands and more, but to do that we need JavaScript
sample Js Button :
<button onclick="doSomething()">Log In</button>
<p id="test">Hello</p>
<script>
function doSomething(){
document.getElementById("test").innerHTML = "GoodBye"
}
</script>
When We click button <p>
tag value changed to “GoodBye”