Check if value is a whitespace
<p>I'm trying to write something like an image font generator, but I can not check if the form value is an space, or give an URL to an whitespace image.</p>

<p>Here is my code:</p>

<pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;untitled&lt;/title&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
function fontgen(text) { 
    var url = './fonts/';
  var letters = text.split('');
  var imgStr = "";
  for (var i in letters) {
    imgStr += '&lt;img src="' +url+letters[i]+ '.gif"&gt;';
  }
  document.getElementById('name').innerHTML = imgStr;
  return false;   
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form name="myform" action=""&gt;
&lt;input type="text" name="myinput" size="20"&gt;&lt;br&gt;
&lt;input type="button" value="Make Font" onclick="return fontgen(document.myform.myinput.value)"&gt;
&lt;/form&gt;
&lt;div id="name"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
