3
I have the following javascript function:
$('input').blur(function() {
var $this = $(this);
if ($this.val())
$this.addClass('used');
else
$this.removeClass('used');
});
she adds the class used
to the element input
clicked if it has value, if not, when losing focus it is without class used
. works properly however these fields are filled with a value that comes from the database, and as it does not occur the click input it does not add class used
, how can I fix this?
perfect! thank you very much! worked!
– Hebert Lima