<body> <input id="idname" value=" this is the value "> </body>
var val1 = $("#idname").val(); alert("val1:"+$.trim(val1)+"***");//只去除两边空格