Arrays in HTML

The creation of an array of URLs to image files is used extensively on this website.

The summary below was generated by AI:

HTML itself does not have arrays — arrays are a JavaScript feature.
If you want to work with arrays in a web page, you use JavaScript inside your HTML.

Many of the DOM Methods to select elements etc create and return arrays of elements in an array or an array like object. For example the getElementsByClassName() method returns such an object.

Function to build an array of image URLs

Top

This is a single dimension array a JSON object would be better. Or is it? I could just use multiple single dimension arrays.

JavaScript Arrays in HTML - the W3C example

Image will appear here

Links

Link to PDF Disabled

If you require a copy please email tempusfugit.me.uk

Top

References -

  • 1 - JavaScript Arrays - https://www.w3schools.com/js/js_arrays.asp
  • 2 - Try and Catch - https:// developer.mozilla.org/ en-US/docs/Web/JavaScript/Reference/ Statements/try...catch