You can use Vanilla JavaScript with JQuery, check this example :
Of course, the code in the previous example needs to be modified to fit your use case, and the HTML field must be used to create a place in the form to render it in, but the principle at the end, is the same.
But to create a child table with features similar to those in frappe, will take more than that, but it is possible.