I am facing issue when I try to insert space using .html() method in JQuery.
Following is my code :
html += '<td >'+description+". "+location;
html += +" "+position;
html += +" "+side+'</td>';
$('#tempResult').html(html);
The result I am getting is as follows:
Green Tint. 0FrontNaNRight
Remove the
+operator from your string.+=takes care of the string concatenation, so the additional+sign simply tries to make the string positive (causing the interpreter to change it toNaN– not a number).a += bis a “shorthand way” (perhaps a simplification) of sayinga = a + b.