I was wondering how can I append a space after an element in JavaScript? I am creating an image and a span in for loop, and I want to append a space after the image and after the span. Here is how I create the tags:
var image = document.createElement("img");
Since you asked for some visual whitespace – the simplest and most flexible way is applying it through CSS, not using a space character:
If you want to only apply it to the specific element you create, you can use JavaScript to apply the CSS: http://jsfiddle.net/aRcPE/.