0

I am trying to color the text Enter Valid Email in Red how can i achieve this Please Help

email_validation.js

$('#email').focusin(function()
{
    $('#email_feed').text('Enter Valid Email...');
})
Mudith Chathuranga Silva
  • 7,253
  • 2
  • 50
  • 58
kunz
  • 1,063
  • 1
  • 11
  • 27

3 Answers3

1
$('#email').focusin(function()
{
    $('#email_feed').html('<span style="color:red;">Enter Valid Email...</span>');
})
madalinivascu
  • 32,064
  • 4
  • 39
  • 55
1

Use .css property

$('#email_feed').text('Enter Valid Email...').css('color','red');
Guruprasad J Rao
  • 29,410
  • 14
  • 101
  • 200
0

You can either use css

#email_feed
{ 
    color: #F00;
}

Or you could continue using jquery and use

$('#email_feed').text('Enter Valid Email...').css({ color : "#F00" )};

Both will achieve the same result

samuelmr
  • 617
  • 4
  • 10