Is there a way to change the CSS border of a div, when an input field gets focus (e.g. when it loses focus, remove the border).
HTML:
<input type="text" name="title" id="title"></input>
<div id="mainTitle">The Main Title</div>
CSS:
#mainTitle {
border: 1px solid #ccc;
}
1 Answer