Please Use HTML data-attributes

If you need to attach custom attributes to an HTMLElement that you can also access from JavaScript or CSS , please use data-attributes . HTML Let&rsquo;s say you have a very simple gallery that has image thumbnails and it displays the full image when you click on a thumbnail and also displays a caption for the image, we can define this gallery in HTML as follows: < div id = 'gallery' > < img src =…