Solved

Identify the Correct Syntax to Prevent a Submit Button from Submitting

Question 71

Multiple Choice

Identify the correct syntax to prevent a submit button from submitting a web form when clicked using the prevent default() method.


A) document.querySelector("input[type='submit']") .onclick = runForm; function runForm(e) { function commands e.preventDefault() ; }
B) document.querySelector("input[type='submit']") .onclick = runForm;
C) document.querySelector("input[type='submit']") .onclick = runForm; function runForm(e) { e.preventDefault() ; }
D) document.querySelector("input[type='submit']") .onclick = runForm; function runForm(e) { }

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions