/* This function clears the default text in a field when clicked on */
$('#edit-field-activity-notes-und-0-value')
.each(function() {
$(this).data('default', this.value);
var mybackground = $(this).css('background');
})
.focusin(function() {
// If the value is the default, clear it
if ( this.value == $(this).data('default') ) {
this.value = '';
$(this).css( 'background', 'white');
}
})
.focusout(function() {
// If the value is empty, revert back to the default value and background
if ( this.value == '' ) {
this.value = $(this).data('default');
this.css = $(this).css ('background', mybackground);
}
});
What exactly is happening here? $(this).css( 'background', 'white'); successfully changes the background color but retains other styling attributes like no-repeat
The lines marked with ** are not functioning as intended.