title: Display Javascript "return" value in a div
body: <p>I have the following script from the <a href="https://github.com/pdeschen/e164.js" rel="nofollow">e164.js</a> library.
  Normally from chrome debugger, I'll use <code>e164.lookup('44123486789</code>); and I'll get the value: <code>Object {Country: "United Kingdom", Code: "UK"}</code></p>
  
  <p>How can I read a phone number from a html div and display the returned result in another html div?
  for example say</p>
  
  <pre><code>&lt;div id="phone"&gt;44123486789&lt;/div&gt;
  </code></pre>
  
  <p>and write the result to:</p>
  
  <p><code>&lt;div id="country"&gt;&lt;/div&gt;</code></p>
  
  <p>Thanks guys.</p>
  
  <p>Here is the script:</p>
  
  <pre><code>    (function() {
  var lookup, prefixes = {
    "1201": [ "US", "United States" ],
    "1202": [ "US", "United States" ],
    "1203": [ "US", "United States" ],
    "1204": [ "CA", "Canada" ],
     "44": [ "GB", "United Kingdom" ],
  };
  lookup = function(phone) {
    if (phone.length) {
      var prefix, c = phone.length;
      for (c; c &gt;= 0; c=c-1) {
        prefix = phone.substring(0, c);
        if (prefixes[prefix]) {
          return { country: prefixes[prefix][1], code: prefixes[prefix][0] };
        }
      }
    }
  };
  if (typeof exports !== "undefined"){
    exports.lookup = lookup;
  }
  if (typeof window !== "undefined"){
    window.e164 = { lookup : lookup};
  }
  })();
  </code></pre>