String对象
<script type="text/javascript">
var str="abcde";
var str1=str.bold();//JavaScript中的String中的bold()方法,加粗
alert(str1);//用alert直接弹出的话,显示的是浏览器解析前的代码“<b>abcde</b>”
document.write(str1);
alert(str1.fontcolor("red"));
document.write("<br>"+str1.fontcolor("red"));//fontcolor()方法,设置字体颜色
document.write("<br>"+str1.link("http://www.baidu.com"));//link()方法,其实添
加的是a标签
alert(str.substring(1,3));//这个表示从脚标1到脚标3,不包含3;为bc
alert(str.substr(1,3));//这个表示从脚标1开始,获取长度为3的字符串;为bcd
</script>