@brianlan25  trim() should be used like this way. 

 

syntax :

String.prototype.trim()

 

 

eg: 

alert (' KB Number ' + kbNumberSub.trim());