How to create an interactive component on js?

How to create a complex component and bind it to different events. That is, the component consists of two textarea fields where 2x will be added to the text, 2 buttons will be the same field for which he can drag around the screen.
These components can be added to a page in any amount by clicking.
How to bind events to each component when you create it in js?
I did, so just think what can be better. Code won't allow, too bulky.
June 10th 19 at 15:07
2 answers
June 10th 19 at 15:09
Now the web components allows you to create any of these frangosul
https://angular.io/
https://reactjs.org/
https://vuejs.org/
https://www.polymer-project.org/

It is of the most prohairclinic There are still natiunii https://www.webcomponents.org/ but they are still in process.
But webcomponents mostly polymer... - Carter21 commented on June 10th 19 at 15:12
not in the process, and a year as v1 is accepted and available in the browsers - timmothy.Tromp43 commented on June 10th 19 at 15:15
What is v1? - Candace.Shiel commented on June 10th 19 at 15:18
there's a table of browser support. From FF shadow dom just announced. - Isaias_Medhurst commented on June 10th 19 at 15:21
June 10th 19 at 15:11
If the handler is alone, then at least add a class or data-
6 handler click and one move. Create a complex component using the designer. And when you click add on the page. I would want that each component node has reference to its function. - Carter21 commented on June 10th 19 at 15:14
Each new component with its node by referring to their function. - timmothy.Tromp43 commented on June 10th 19 at 15:17

Find more questions by tags JavaScript