Jquery li element id
Posted
by Gazler
on Stack Overflow
See other posts from Stack Overflow
or by Gazler
Published on 2010-01-21T18:26:18Z
Indexed on
2010/05/18
17:50 UTC
Read the original article
Hit count: 144
jQuery
|context-menu
Hi,
I am using a jquery contextmenu plugin for right click menus which I am trying to add to each li element of an unordered list with the ID mailbox. The code I have is:
$("#mailbox > li").contextMenu('myMenu1', {
bindings: {
'open': function(t) {
alert('Trigger was '+t.id+'\nAction was Open');
}
//CODE SNIPPED
});
My assumption is that this should alert the id of the list element that the contextMenu was called from, however it is returning an empty string. Am I accessing/assigning these correctly?
t is an object HTMLLIElement in the context above by the way.
Cheers, Gazler.
© Stack Overflow or respective owner