1. I must have option to delete the selected gruop/option (for example if somebody do mistake). 2. There must be an option that you cannot add another group, if you don't add in the previous at least one option.

That much is simple. You give the add group button an identifier so that you can easily access it from the script.When you add a group, you set the disabled property of the button to be true. When you add an option, you set the disabled property of the group button to false.

When I will add the group, add the option 1 to this, add the another option 2 to this and delete these two options, later add option you will see Option 3 - not option 1 in this group. Why and how to repair that?

Second questions is if I mind to delete group - it's delete only group - not all content of a div (all options). I must have two different divs for that?

Thank you very much for your answers @pauls_wikins from New Zealand, greetings from Poland

When I will add the group, add the option 1 to this, add the another option 2 to this and delete these two options, later add option you will see Option 3 - not option 1 in this group. Why and how to repair that?

You will need to loop through the remaining options in that section and renumber them.

bigziomal said:

Second questions is if I mind to delete group - it's delete only group - not all content of a div (all options). I must have two different divs for that?

The options are all contained within the group div, so just removing the group div will result in all of the contained options being removed too.