Hapus spasi dalam string js
str.replace(/\s+/g, '')
Dangerous Duck
str.replace(/\s+/g, '')
var str = " Hello World! ";
alert(str.trim());