JQuery (javascript) On selectlist change – get selected/current value and do some action

If you have form with select list

    <form name="exampleform" action="index.php" method="POST">
        <select name="myselect" id="myselectid">
            <option value="apple">Apple</option>
            <option value="banana">Banana</option>
            <option value="melon">Melon</option>

and you need to do some action when user change/select some items in select list then you can use this construction:

    $("#myselectid").change(function () {
            var user_selected = $(this).val();
            console.log('User selected value: ' + user_selected);

How to create HTML select lists in Joomla!

If you need create some HTML select list with items then you can use Joomla API.
Joomla! provide special class JHTML for creating form elements, such as selectlist, radiolist, booleanlist and etc…
Most popular. Get data from database and create selectlist.
Example ↓

$selected = JFactory::getInt('selectlist_name', 0); 

$db = JFactory::getDBO();
    $query = "SELECT `id` AS `value`, `title` AS `text` FROM `#__your_table` WHERE `cid`=1";
$items_from_db = $db->loadObjectList();

$selectlist_data[] = JHTML::_('select.option',  '0', "- Select item -", 'value', 'text' );
$selectlist_data = array_merge( $selectlist_data, $items_from_db);

$list = JHTML::_( 'select.genericlist',
                    'size="1" class="inputbox selectlist"', 
                    'value', 'text', 
                    $selected, 'selectlist_id', 
echo $list;

Result ↓