jQuery:
$(document).ready(function() {
$('.text').load(function() {
if (this.value == this.title) {
$('.text').addClass("highlight");
}
});
});
CSS:
.highlight
{
background: #FFA9B8;
border: 1px solid red;
}
HTML
<label for="first_name">first name: </label>
<input type = "text" name = "first_name" class = "text" value = "First..." title = "First..." />
<label for="last_name">last name: </label>
<input type = "text" name = "last_name" class = "text" value = "Last..." title = "Last..." />
I essentially want to add the class "highlight" to the background of the 2 input fields when the page is loaded...only when both the title and value are the same.
Thank you -Art