What I am trying to do is that if the value of the key matches the php code I want it to add a selected attribute in the option. is it possible to collaborate php and jquery?
$('#vessel_sub_category_id').append("<option value=" + key + " "if(key == <?php echo $select_update['vessel_sub_category_id']; ?>){'selected';}" >" + value + "</option>");