HTML Form How to - Focus and hover effect for disabled input








Question

We would like to know how to focus and hover effect for disabled input.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
input[disabled].btn:hover, input[disabled].btn:focus {
  color: green
}<!--  w  ww  . j av a 2  s. c o  m-->
</style>
</head>
<body>
  <input disabled="disabled" class="btn btn-blue span3" type="submit"
    value="Change">
</body>
</html>

The code above is rendered as follows: