Dynamically map button with div

hi all,

I want to link a button with div dynamically using id’s for example.

I have two buttons and two div this is been dynamically created if i click the second button it has to go second div if i click first button it first button has to visible. Using pure vanila javascript.

Here is the codepen http://codepen.io/karthic2914/pen/yNNoKv.

Thanks in advance

In order to achieve that, the standard technique is to hide all of the divs that might be shown, after which you can then show the desired div.

Hi Paul,

Sorry for the late reply. If I hide the divs which I am not showing initially when i click the second button the second div has to show.

Thanks in advance

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.