HTML Form How to - Control button value or content using CSS








Question

We would like to know how to control button value or content using CSS.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
button:before {<!-- w w w.  j  a va 2 s  . c  o m-->
  content: "Click me";
}
</style>
</head>
<body>
  <button></button>
</body>
</html>

The code above is rendered as follows: