{"action":"created","issue":{"url":"https://api.github.com/repos/daneWilliams/jquery.dropdown/issues/15","repository_url":"https://api.github.com/repos/daneWilliams/jquery.dropdown","labels_url":"https://api.github.com/repos/daneWilliams/jquery.dropdown/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/daneWilliams/jquery.dropdown/issues/15/comments","events_url":"https://api.github.com/repos/daneWilliams/jquery.dropdown/issues/15/events","html_url":"https://github.com/daneWilliams/jquery.dropdown/issues/15","id":133905014,"number":15,"title":"Selected Item","user":{"login":"faravaghi","id":4525807,"avatar_url":"https://avatars.githubusercontent.com/u/4525807?v=3","gravatar_id":"","url":"https://api.github.com/users/faravaghi","html_url":"https://github.com/faravaghi","followers_url":"https://api.github.com/users/faravaghi/followers","following_url":"https://api.github.com/users/faravaghi/following{/other_user}","gists_url":"https://api.github.com/users/faravaghi/gists{/gist_id}","starred_url":"https://api.github.com/users/faravaghi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faravaghi/subscriptions","organizations_url":"https://api.github.com/users/faravaghi/orgs","repos_url":"https://api.github.com/users/faravaghi/repos","events_url":"https://api.github.com/users/faravaghi/events{/privacy}","received_events_url":"https://api.github.com/users/faravaghi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-16T07:21:35Z","updated_at":"2016-02-25T17:11:13Z","closed_at":null,"body":"How can get Selected item in ul element?\r\nor can you insert event for this plugin? for example change menu, selected or ..."},"comment":{"url":"https://api.github.com/repos/daneWilliams/jquery.dropdown/issues/comments/188882233","html_url":"https://github.com/daneWilliams/jquery.dropdown/issues/15#issuecomment-188882233","issue_url":"https://api.github.com/repos/daneWilliams/jquery.dropdown/issues/15","id":188882233,"user":{"login":"zatchgordon","id":6401771,"avatar_url":"https://avatars.githubusercontent.com/u/6401771?v=3","gravatar_id":"","url":"https://api.github.com/users/zatchgordon","html_url":"https://github.com/zatchgordon","followers_url":"https://api.github.com/users/zatchgordon/followers","following_url":"https://api.github.com/users/zatchgordon/following{/other_user}","gists_url":"https://api.github.com/users/zatchgordon/gists{/gist_id}","starred_url":"https://api.github.com/users/zatchgordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zatchgordon/subscriptions","organizations_url":"https://api.github.com/users/zatchgordon/orgs","repos_url":"https://api.github.com/users/zatchgordon/repos","events_url":"https://api.github.com/users/zatchgordon/events{/privacy}","received_events_url":"https://api.github.com/users/zatchgordon/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T17:11:13Z","updated_at":"2016-02-25T17:11:13Z","body":"if the defaults section of the plugin I added a callback called onOptionSelect\r\n`defaults: {\r\n\t\t\t//callBack\r\n\t\t\tonOptionSelect: function(opt){return false;}, \r\n\t\t\t// Animation\r\n\t\t\tanimate: true,\r\n\t\t\tspeed: 300,\r\n\r\n\t\t\t// Auto\r\n\t\t\tautoClose: true,`\r\n\r\nAnd then in the \"toggleText\" function where it sets the .html() to \"text\" i added a call to the onOptionSelect \r\n\r\n`if ( text ) {\r\n\r\n\t\t\t\telem.toggleText.html( text );\r\n\t\t\t\tself.options.onOptionSelect( text);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\telem.toggleText.html( elem.toggleButton.data( 'dropdown-text' ) );\r\n                                self.options.onOptionSelect( text);\r\n\r\n\t\t\t}`\r\n\r\nnow in the code where you call the plugin $('ul').dropdown you can add the parameter of onOptionSelect: function(value){}\r\n\r\n\r\n`$(element).dropdown({\r\n                        selectParents: false,\r\n                        toggleText: \"\\&nbsp; \",\r\n                        onOptionSelect: function (value) {\r\n                                  //here this will return the value of the selected item \r\n                                 //and then you can do whatever you want with it\r\n                            }`"}}