STREETS IN TIME PROJECT: Javascript code for populating ‘alt’ tags for images

Javascript variables  in <head> section, to be populated each time a new page is created:

<script type = "text/javascript">
var image_loc = "The Booth Museum, Dyke Road, Hove"
var year_then = "1905"
var year_now = "2013"
</script>

Variables called within ‘alt’ tag for then and now images:

<script> document.write("<div id= 'slideshow'><img src = '"+image_now+"' alt = '"+image_loc+", "+year_now+"'/><img src = '"+image_then+"' alt = '"+image_loc+", "+year_then+"'/></div>") </script>

 

Leave a comment