Can it be done, just Yes or No?
Normally you will consume a web map hosted in ArcGIS Online by one of the many templates or solutions ArcGIS Online offers. The moment you start modifying or extending functionality you will most likely download the template or solution and host it on your web server.
Can you elaborate a little more about what you specifically need in terms of funcionality?
Thanks for the answer.
But now I suspect that it is not possible.
What funcionality would you like to add? There are some great things you can configure with the Web AppBuilder for instance. See: Web AppBuilder for ArcGIS | ArcGIS
I have tried Web AppBuilder for ArcGIS | ArcGIS but it gives me only options that I already have in ArcGIS Online.
I wanted to host my code in ArcGIS Online, because it is just a web map with more layers. Hosting on ArcGIS Online is my final task, and I have already made whole map with all layers.
If it is not possible, one of my problems is how to show data from more feature layers in popup of one layer, in ArcGIS Online web map?
Can you help me with that, Is it possible at all?
If you need to customize an app, you will need to download the code, adapt it and publish or your own web server. Using the Web AppBuilder developer edition would be the way to go. There is a group dedicated to custom widgets: Web AppBuilder Custom Widgets where you can find example of very useful widgets ready to deploy on your server. An example is Identify Widget Version 22.214.171.124 - 08/16/2017 created by rscheitlin which shows how to obtain the results of an identify for multiple layers in a single widget.