I want to create a html5 game. The game master uses a chat-like system to communicate with the user. The chat messages should appear one after another, each with a specific delay. I named the elements using the id parameter from 1 to n and I'm just looping through the ids to display them one after another.
I want to set a custom delay for every message, without writing anything inside of the .js file I'm using. The best way would be writing it inside of the html tag, like this: <p class="msg" id="1" delay="0">. How can I access the value stored in delay, when I'm accessing the element with $("#1")?