import document from 'document' ; let demo = document . getElementById ( 'demo' ) as GraphicsElement ; demo . style . display = 'none' ; demo . style . display = 'inline' ; function toggle ( ele ) { ele . style . display = ele . style . display === 'inline' ? 'none' : 'inline' ; } toggle ( demo ) ; toggle ( demo ) ;