I have a data attribute like:
<a href="stuff" data-open-dialog="location-XXXX">click</a>
<a href="stuff" data-open-dialog="location-YYYY">click</a>
How can I bind to data-open-dialog, and obtain value, either XXXX or YYYY?
I know how to bind to a specific value, like:
a[data-open-dialog="location-XXXX"]
but how can I make the value dynamic and then obtain the value on click?
thanks
What you are doing is not really “bind”-ing. You just want to retrieve its value, or so I think.Try something like this:
locationwill then hold location-XXXX or location-YYYY. It should be a simple matter for you to strip the “location-” part.