jQuery改变div内容并增加css样式

var account = JobCircle.Util.Common.getSession('account');

    if(!account){

    $("#iflogin").html('<a href="login.html">登陆</a>');

    $("#iflogin >a").css({"color":"#ccc","font-size":"16px","text-decoration":"none"});

 

 

 

=================================================================================

$(function(){

	var account = JobCircle.Util.Common.getSession('account');

	if(!account){

	$("#iflogin").html('<a href="login.html">登陆</a>');

	$("#iflogin >a").css({"color":"#ccc","font-size":"16px","text-decoration":"none"});

	$("#account").html('<a href="register.html">注册</a>');

	$("#account >a").css({"color":"#ccc","font-size":"16px","text-decoration":"none"});

	$("#qiandao").html('<a href="#">签到</a>');

	$("#qiandao >a").css({"color":"#ccc","font-size":"16px","text-decoration":"none"});

	$("#logout").hide();

	}

	else{

		$("#logout,#qiandao,#iflogin,#account").show();

		$("#account").val(account);

	}

});

  

你可能感兴趣的:(jquery)