adding toggle button

adding toggle button through js instead of html