JS常用函数

<html>
<body>
<script type="text/javascript">
//1. trim()函数,去除前后空格
var str = " Hello"
var str_trim = str.trim();
if(str_trim == 'Hello'){
    alert("trim:"+str_trim);
}
</script>

</body>
</html>

 

posted @ 2018-03-17 18:02  达摩院的BLOG  阅读(90)  评论(0编辑  收藏  举报