How to set focus on elgg modal form

Hi everyone. 

I am using the following code for creation my modal form on elgg.

echo elgg_view('output/url', [
   'text' => ' ', //'text' => elgg_echo('add'),
   'href' => 'ajax/view/forms/pessek_profile/'.$section.'?guidp='.$user_guid,
   'class' => 'btn btn-primary btn-xs glyphicon glyphicon-plus elgg-lightbox', 
   'data-colorbox-opts' => json_encode(['maxHeight' => '85%', 'maxWidth' => '100%']),
]);
 
My modal form is dsplayed perfectly but I dont know how to set focus by default to a given field of my modal form.
 
I tried by using the following but nothings happen.
 
elgg_view_field(array(
   '#type' => 'text',
   '#label' => elgg_echo('gcconnex_profile:experience:country'),
   '#help' => elgg_view_icon('help') . elgg_echo('gcconnex_profile:experience:country:help'),
   'required' => true,
   'name' => 'country',
   'value' => $experience->country,
   'class' => 'gcconnex-experience-country',   
   'onfocus' => true,
));
 
what I am suppose to do ?
 
Best regard.
 
Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking