javascript event preventdefault is a button onclick code example Example: event preventdefault event.preventDefault()