I'm kind of new with JQuery, so this is what I'm trying to do: here I'm creating a drop-down menu when clicking on the icon (called 'otherActions').
If the user selects the first I want it do do something (like reset password). If the second one is selected I want it to do something else.
How can I do this using JQuery? I don't know where the methods should be placed. Thank you so much for the help!
var otherActions = $('<div class="icon" style="...." title="..."></div>');
$(otherActions).click(function()
{
var menuDiv = $('#otherActions');
if (menuDiv.length == 0)
{
menuDiv = $('<div id="otherActions" class="myObject" style="..."></div>');
$('body').append(menuDiv);
}
otherActions = new myObject(menuDiv);
otherActions.addItem('Action 1', 0); //myObject methods
otherActions.addItem('Action 2', 1);
otherActions.popupXY(x, y); //myObject method that creates the drop-down list
});
result.append(otherActions); // this is just one of the icons I have to set up