I’m using the following code to create a simple form. How do I make it so that when someone clicks in one of the input fields, the border changes colour? Thanks in advance
<style>
.texta {
color: #CDCBCB;
background-color: #FFFFFF;
border: 1px solid #E2E2E2;
font-style:italic
}
.sendbutton {
background:#F6F6F6; color:#999999;
border: 1px solid #E2E2E2;
cursor:pointer;
padding:5px 10px;
-webkit-border-radius:8px
}
</style>
<form action="mailto:email@email.com" method="post" enctype="text/plain">
<div style="height:12px;"><input type="text" name="name" value="Name (required)" size="40" class="texta"></div><br>
<div style="height:12px;"><input type="text" name="mail" value="Email (required)" size="40" class="texta"></div><br>
<div style="height:12px;"><input type="text" name="comment" value="Subject (required)" size="40" class="texta"></div><br>
<textarea name="Message" value="Message (required)" cols="40" rows="6" class="texta"></textarea><br>
<br><input type="submit" value=" Send " class="sendbutton">
</form>
Add a CSS rule for
.texta:focusand setborder-color.