码迷,mamicode.com
首页 > 其他好文 > 详细

输出字体颜色 "<li><font color=red>" + ......+ "</font>"

时间:2017-08-06 13:57:42      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:nbsp   rip   style   out   lan   lang   img   script   log   

<title>4-15</title>
<script language="javascript">
<!--
    var students = new Array( "杨宗楠", "杨玉婷", "李莉" );
    for( index in students )
    {
        if( students[index] != "杨宗楠" )     //不是“杨宗楠”就输出为黑色字体
        {
            document.write( "<li>" + students[index] )
        }
        else                                // 是杨宗楠输出为红色字体
        {
            document.write( "<li><font color=red>" + students[index] + "</font>" );
        }
    }
-->
</script>

out:

技术分享

 

输出字体颜色 "<li><font color=red>" + ......+ "</font>"

标签:nbsp   rip   style   out   lan   lang   img   script   log   

原文地址:http://www.cnblogs.com/huodaihao/p/7294448.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!