Looking for tips on how to style the input[type=submit]
element when the input[type=text]
is in focus.
Consider this scenario:
<form id="example">
<input type="text" name="search">
<input type="submit" value="Search">
</form>
<style>
#example > input[type="text"]:focus {
// apply styles to the input[type="submit"]
}
</style>
Trying to achieve consistency between the border colors of the search input and submit button. The challenge lies in changing the styling of one element when another is focused, such as in a wordpress theme with an inline search form.
One option is to style the enclosing div, but then the issue of focusing on one element affecting another arises.
Wondering if CSS3 has the capability to handle this or if turning to a JavaScript solution is inevitable as a last resort.