jQuery去除空格的$.trim()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="../js/jquery-3.2.1.min.js"></script>
<title>Title</title>
<script>
$(function () {
if($("#pid").text()==$.trim(" abc ")){
alert($("#pid").text());
}
});
</script>
</head>
<body>
<p id="pid">abc</p>
</body>
</html>