It’s very simple…i’ll give you some step just follow those & you will get what you want,
Step 1) : Create your HTML same as you screenshot. like,
<form>
<textarea name=”txt” class=”txt”></textarea><span class=”errtxt”>
</span>
<input type=”submit” name=”Submit” class=”submit”/>
</form>
Step 2) : Add you script (jquery/java script) on header within “<head>”.
& add this code as well just below the script…
<script>
$(document).ready(function(){
$(‘.submit’).click(function(){
vat txt = $(‘.txt’).val();
if(txt)
{
$(‘.errtxt’).css(‘color’,’#ff0000′);
$(‘.errtxt’).html(‘give me a text’);
return false;
}
});
$(‘.txt’).keypress(function(){
$(‘.errtxt’).css(‘color’,’#117004′);
$(‘.errtxt’).html(‘send successful’);
});
});
</script>
sorry, if error come. i didn’t test it. but surely this will work for you.
Thank you,