html form preventdefault in javascript code example Example: js preventdefault function(event) { event.preventDefault(); }