js中怎么加粗
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><div id="time"></div><script language="javascript" type="text/javascript"> function setTime(){ var dt=new Date(); var arr_week=new Array("周日","周一","周二","周三","周四","周五","周六"); var strWeek=arr_week[dt.getDay()]; var strHour=dt.getHours();
var strMinutes=dt.getMinutes(); var strSeconds=dt.getSeconds(); if (strMinutes<10) strMinutes="0"+strMinutes; if (strSeconds<10) strSeconds="0"+strSeconds; var strMonth=(dt.getMonth()+1)+"月"; var strDay=dt.getDate()+"日"; var strTime=strHour+":"+strMinutes+":"+strSeconds; time.innerHTML=""+strTime+" <br> "+strMonth+strDay+" "+strWeek; /* time是上面DIV的ID值,看要把它放在网页哪边可以换了*/ }setInterval("setTime()",1000); /* 这个是跳动函数,后面是多久跳以毫秒,1000就是一秒跳动 */ </script></body></html>
这段代码怎么让时分秒边粗。 展开
var strMinutes=dt.getMinutes(); var strSeconds=dt.getSeconds(); if (strMinutes<10) strMinutes="0"+strMinutes; if (strSeconds<10) strSeconds="0"+strSeconds; var strMonth=(dt.getMonth()+1)+"月"; var strDay=dt.getDate()+"日"; var strTime=strHour+":"+strMinutes+":"+strSeconds; time.innerHTML=""+strTime+" <br> "+strMonth+strDay+" "+strWeek; /* time是上面DIV的ID值,看要把它放在网页哪边可以换了*/ }setInterval("setTime()",1000); /* 这个是跳动函数,后面是多久跳以毫秒,1000就是一秒跳动 */ </script></body></html>
这段代码怎么让时分秒边粗。 展开
展开全部
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
RunJS 演示代码
</title>
<script language="javascript" type="text/javascript">
onload =function(){
var now = new Date();
var strWeek=["周日","周一","周二","周三","周四","周五","周六"][now.getDay()];
var strHour=now.getHours();
var strMinutes=now.getMinutes();
var strSeconds=now.getSeconds();
var reg = /^\d$/;
reg.test(strMinutes) ? strMinutes="0"+strMinutes : 0;
reg.test(strSeconds) ? strSeconds="0"+strSeconds : 0;
var strMonth=now.getMonth()+1+"月";
var strDay =now.getDate()+"日";
var strTime=strHour+":"+strMinutes+":"+strSeconds;
strTime=strTime.bold();
time.innerHTML=strTime+" <br / > "+strMonth+strDay+" "+strWeek;
setTimeout(arguments.callee, 1000);
}
</script>
</head>
<body>
<div id="time">
</div>
</body>
</html>
展开全部
最简单的方法就是在输出的内容上加上<strong>标签,也就是将将20行的改成
var strTime="<strong>"+strHour+":"+strMinutes+":"+strSeconds+"</strong>";
var strTime="<strong>"+strHour+":"+strMinutes+":"+strSeconds+"</strong>";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
加上一句 time.style.font-weight=“blod”;
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询