I’m using PHP tidy and it automatically indents markup, adds tabs and spaces. Please take a look at this.
I got 2 questions:
- How to remove this extra spaces from selected option (The reason is PHP tidy library: adds extra space to indent markup. But I can’t turn it off, so I’m searching some JS solution to trim text)

- How to make “Select one” to act as HTML5 placeholder?
You’re getting spaces because your options’ text is on a separate line in HTML with indenting. You could remove them first:
As for the placeholder, use
.attr("placeholder", ...)instead of.val(...):http://jsfiddle.net/njh85/6/