The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to trigger click event

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #295429

    I have this code working as it is found at

    This page loads with all tiles purple. You will note everytime you click a purple tile it changes to yellow.

    How could i create a link so when i enter it into a browser the appropriate tile is showing as coloured (yellow) on page load?


    You could make use of ID’s on your elements, match these ID’s in your URL and read them in the onload function like this:

    window.onload = () => {
    const item = document.querySelector(window.location.hash);
    if (item) {

    Optionally followed by msnry.layout();.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.