[sourcecode language="html"]
<html>
<head>
<title>
jQuery trim example
</title>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
<button>Click on me to see the effect</button>
<script>
$("button").click(function () {
var exampleStr = " jQuery trim example ";
alert("'" + exampleStr + "'");
exampleStr = jQuery.trim(exampleStr);
alert("'" + exampleStr + "'");
});
</script>
</body>
</html>
[/sourcecode]
No comments:
Post a Comment