Javascript String.fontcolor()方法
作者:--
发布时间:2019-11-20
评论:0
阅读:3
此方法会导致就好像它是在一个字符串被显示在指定的颜色 <font color="color">标记。
语法
string.fontcolor( color )
下面是参数的详细信息:
返回值:
例子:
<html>
<head>
<title>javascript string fontcolor() method</title>
</head>
<body>
<script type="text/javascript">
var str = new string("hello world");
alert(str.fontcolor( "red" ));
</script>
</body>
</html>
这将产生以下结果:
<font color="red">hello world</font>