I'm working on a project where I need to use something like bind, on, onclick or such.
I have a navigation setup with a ul li structure,
<ul>
<li> </li>
<li> </li>
<li>
<ul>
<li><a class="mennav" name="t2">item 1</a></li>
<li><a class="mennav" name="t3">item 2</a></li>
</ul>
</li>
</ul>
since all of this is generated through php, I don't know in advance how many items and name tags will exist.
Important; I have to use the name property and only where <a> has a name tag.
there will be no other <a> tags in the document a name tag, only these, so perhaps it's not necessary to go through the ul li ul li a sequence.
perhaps something this nature,
$(a name).bind('click', function() {
var name;
alert('User clicked on name');
});
I have a navigation setup with a ul li structure,
<ul>
<li> </li>
<li> </li>
<li>
<ul>
<li><a class="mennav" name="t2">item 1</a></li>
<li><a class="mennav" name="t3">item 2</a></li>
</ul>
</li>
</ul>
since all of this is generated through php, I don't know in advance how many items and name tags will exist.
Important; I have to use the name property and only where <a> has a name tag.
there will be no other <a> tags in the document a name tag, only these, so perhaps it's not necessary to go through the ul li ul li a sequence.
perhaps something this nature,
$(a name).bind('click', function() {
var name;
alert('User clicked on name');
});