Can someone explain why the following snippet does not add
to both #a
and #b
?
HTML:
I tried a trick and it worked. I just nested the function of one button click in another. i mean I am changing the parent every time to avoid this issue. the main thing is that when i am writing the click function for button1 click the button2 logic is written under that and the button3 click logic is written inside button2 click method like a hierarchy. Just see the code. you will get it.
Hello, world!
DOM Element Inserting!