[removed] style.display:'block' doesn't work

前端 未结 3 1702
猫巷女王i
猫巷女王i 2021-01-21 06:08

any idea why this JavaScript just shows \"block\" and not the content of the (hidden) DIV?




3条回答
  •  春和景丽
    2021-01-21 07:05

    Because you want to use an onclick event handler, not the href attribute:

    Show my DIV
    

    jsFiddle example

    (side note: inline JavaScript is usually frowned upon)

提交回复
热议问题