Articles in this section
Category / Section

How to get the id and value of the selected item in a ListBox?

1 min read

How to get id, value of the selected item in ejListBox "select" event?

 

We can get the id, value of the currently selected item of ListBox through ‘select’ event’s arguments.

Select event will get triggered when we select a list item.

Please refer the below code snippets.

[_script]

jQuery(function ($) {

 

           $("#select").ejListBox({select:"Onselect"});

 

});

[_script]

function Onselect(args) {

selecteditem_id = args.item.attr("id")

selecteditem_value = args.value;

alert("id of select item : " + selecteditem_id + "\n" + "value of select item : " +selecteditem_value);
}

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied