event preventdefault for button typescript code example Example: event preventdefault event.preventDefault()