How to display a particular word in bold using jquery.
function OnSuccess(response) {
var user = $('#username').val();
if (response.d == 1) {
$('#result').text(user + ' already Exists');
$('#Button1').attr('disabled', true);
} else {
$('#result').text('Username '+user +' Ok');
$('#Button1').attr('disabled', false);
}
}
Here i want to make the username(user) to be bold ,rest of the sentence must be normal.Is it possible by using jquery?
Use html
instead of text
function OnSuccess(response) {
var user = $('#username').val();
if (response.d == 1) {
$('#result').html('<b>' + user + '</b> already Exists');
$('#Button1').attr('disabled', true);
} else {
$('#result').html('Username <b>' + user + '</b> Ok');
$('#Button1').attr('disabled', false);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With