Say I have a something like this:
<div id="myTop">
<a href="#" data-role="button" data-theme="a">one</a>
<a href="#" data-role="button" data-theme="a">two</a>
...
</div>
And I want to change the data-theme on the button click. I’ve tried this:
$('#myTop').on("click", "a", function (event) {
$(event.target).attr('data-theme', "b");
});
Problem with this approch is that I’m not sure at what part am actually clicking that might be a span sometimes and a anchor. How could I make sure that I change the theme on only the a tag?
Thanks for any help
Larsi
(Edit: removed the themeing part of this question)
You could try something like this:
JS
HTML