Remova o espaço em branco JavaScript
var str = " Some text ";
str.trim();
Gifted Goshawk
var str = " Some text ";
str.trim();
yourvariable.trim()