【发布时间】:2016-02-09 12:13:23
【问题描述】:
我想改变html(username + ' is already exist. Please try another one');的字体颜色
但我不知道如何改变它。
function check_availability(){
//get the username
var username = $('#username').val();
//use ajax to run the check
$.post("<?php echo base_url();?>loginFunction/checkUsername", { username: username },
function(result){
//if the result is 1
if(result == 1){
//show that the username is available
$('#username_availability_result').html(username + ' is Available');
}else{
//show that the username is NOT available
$('#username_availability_result').html(username + ' is already exist. Please try another one');
}
});
【问题讨论】:
-
你可以用 span 和 style 包裹它。
-
$('#username_availability_result').html(username + ' is already exist. Please try another one').css( "color", "red" );api.jquery.com/css -
你还没有回复任何答案
标签: php css codeigniter