I have this html
<a class="idents" href="#"></a>
<a class="idents" href="#"></a>
<a class="idents" href="#"></a>
and this javascript
function show(selected) {
$('a[class|="idents"]').each(function(index) {
if ($(this).attr("id") == selected) {
$(this).show(600);
}
else {
$(this).hide(600);
}
});
}
I will like to remove the repeating a class from the html put all anchors into a div
Like this
<div class="idents">
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
But I am completely javascript newbie and don’t how to change the javascript to “match” the change in the html.
Just like you would select with css.