I have gallery and a custom css drop-down menu to choose a category. If the user does not have javascript enabled, he should be able to click the a anchor without any problems. Otherwise, jquery & ajax are used.
My problem is, how do I know the category selected? Storing it as an attribute isn’t an option, because it doesn’t validate, even though it’s convenient. I use HTML5 doctype but I am not sure if I should use data, because I might need to validate it to xhtml again.
Are there any other good options?
I have gallery and a custom css drop-down menu to choose a category. If
Share
would work in the context of an event handler assigned to an element where
thisrefers to the element.If you have to store it initially on page load, use
data-attribute.