Change $('.selcompany').on('change', function ()
to $('#tabletomodify').on('change','.selcompany', function ()
$('#tabletomodify').on('change','.selcompany', function ()
{
var optionSelected = $("option:selected", this);
var valueSelected = this.value;
alert(valueSelected);
});
The problem occurred because event observer is attached before the elements has been added to the DOM.
Demo : JsFiddle