I want to get / fetch value of select option from for-each loop in JavaScript
code
<?php $user = $this->admin_model->getData('user'); ?>
<select class="form-control" name="user" id="user">
<option value="">Select User to Assign</option>
<?php foreach ($user as $row): ?>
<option value="<?php echo $row->id; ?>"><?php echo $row->user_name</option>
<?php endforeach; ?>
</select>