Archive for the ‘ jquery ’ Category

How to add onclick values to a list in Jquery

Posted by

This bit of jquery will add an onclick value to list items based on the link within the list item.

The idea is that the whole lists items become links rather than just the link text. Its ideal if you want to colour the background of a list item and have it clickable.

[sourcecode language=’javascript’]


The only downside to this method is if you have a list within a list such as a nested Drupal menu.