最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery.trim()

jQuery.trim( str ) 返回: String

描述: 去掉字符串起始和結(jié)尾的空格。

  • version added: 1.0jQuery.trim( str )

    str修剪的字符串。

$.trim()函數(shù)刪除提供字符串的所有換行符,空格(包括非中斷空格),開始和結(jié)束tab。如果這些空白字符在字符串中間發(fā)生時,它們將被保留。

Examples:

Example: 刪除在開始和在字符串的末尾兩個空格。

<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <button>Show Trim Example</button>
<script>

$("button").click(function () {
var str = "     lots of spaces before and after     ";
alert("'" + str + "'");

str = jQuery.trim(str);
alert("'" + str + "' - no longer");
});

</script>

</body>
</html>

Demo:

Example: Remove the two white spaces at the start and at the end of the string.

$.trim("  hello, how are you?  ");

Result:

"hello, how are you?"
jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
额济纳旗| 观塘区| 昌平区| 浙江省| 永川市| 沂南县| 东方市| 宁强县| 郑州市| 郯城县| 洛阳市| 宜昌市| 八宿县| 旺苍县| 浏阳市| 东乡县| 林口县| 高阳县| 西畴县| 大港区| 喀什市| 泰来县| 秀山| 甘德县| 贵南县| 德钦县| 诏安县| 榆树市| 吉水县| 唐山市| 桦川县| 栾川县| 马山县| 深水埗区| 黄梅县| 科技| 边坝县| 介休市| 大宁县| 庆元县| 梁平县|