首页 > 其他 > 详细

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

时间:2017-08-06 13:38:59      阅读:214      评论:0      收藏:0      [点我收藏+]
<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>"

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!