Edit in JSFiddle

<h1 id="title">Loading...</h1>
<div id="content"></div>
<div id="metafields"></div>
<script src="cosmicjs.browser.min.js"></script>
<script>
  var config = {
    bucket: {
      slug: 'easy-browser-example'
    },
    object: {
      slug: 'home'
    }
  };
  Cosmic.getObject(config, config.object, function(err, res) {
    var object = res.object;
    document.getElementById('title').innerHTML = object.title;
    document.getElementById('content').innerHTML = object.content;
    var metafields = object.metafields;
    var images = '';
    metafields.forEach(function(metafield) {
      images += '<h2>' + metafield.title + '</h2>';
      images += '<img width="300" src="' + metafield.imgix_url + '?w=500"/>';
      images += '<br><br>';
    })
    document.getElementById('metafields').innerHTML = images;
  });
</script>