I have a drop-down list of items like below, and I would like to on-click send just the name such as “classes” or “inheritance” , to my controller.
<li><a href="#">Pointers</a></li>
<li><a href="#" class="parent">Classes</a>
<ul>
<li><a href="#">Shapes</a></li>
<li><a href="#">Submenu</a></li>
</ul>
</li>
<li><a href="#">Inheritance</a></li>
<li><a href="#">Polymorphism</a></li>
<ul>
My question is should if I should use Javascript, such as:
<li><a href="#" id="someId" onclick="SomeMethod(this);" > Pointers</a>
Then How do i retrieve the element in my function and send to controller?
or can I use use form action ?
No need for javascript…
HTML:
Controller: