Add Field Dynamically Into Child Table

I want to dynamically add new filed and its value into child table using js which is not define in child table doctype.

Is there any way to do this. If there is any way then please tell me.

Thank you.

Explain the use case.

Hello following is my scenario,

I have a parent docttype ‘A’, It has field ‘a1’ , ‘a2’, and child table ‘B’.

In doctype B, I have field ‘b1’ , ‘b2’ and button ‘btn’.

Now when I insert record into child table ‘B’ for doctype ‘A’, I can insert value to ‘b1’, ‘b2’ easily, as it is already define.

But I want to add field ‘b3’ , ‘b4’, ‘b5’ … (which is not yet defined in child doctype ‘B’) on click event of button ‘btn’.

Thank You

You will have to create and hide those fields (b3, b4, b5)