JSFiddle - React, Tailwind, and code Playground
by brigand
HTML
<form action="https://alienwp.com/wp-comments-post.php" method="post" id="commentform" class="comment-form">
<p class="comment-notes"><span id="email-notes">Your email address will not be published.</span> Required fields are marked <span class="required">*</span></p>
<p class="comment-form-comment"><label for="comment">Comment</label><textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p>
<p class="comment-form-author"><label for="author">Name <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" required="required"></p>
<p class="comment-form-email"><label for="email">Email <span class="required">*</span></label> <input id="email" name="email" type="text" value="" size="30" maxlength="100" aria-describedby="email-notes" required="required"></p>
<p class="comment-subscription-form"><input type="checkbox" name="subscribe_comments" id="subscribe_comments" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;"> <label class="subscribe-label" id="subscribe-label" for="subscribe_comments">Notify me of follow-up comments by email.</label></p>
<p
class="comment-subscription-form"><input type="checkbox" name="subscribe_blog" id="subscribe_blog" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;"> <label class="subscribe-label" id="subscribe-blog-label" for="subscribe_blog">Notify me of new posts by email.</label></p>
<div
class="sgr-recaptcha">
<div style="width: 304px; height: 78px;">
<div><iframe src="https://www.google.com/recaptcha/api2/anchor?ar=1&k=6Lf9rCETAAAAAA6W7FdUyKsyx6gjbb0Az1BB9Sc1&co=aHR0cHM6Ly9hbGllbndwLmNvbTo0NDM.&hl=en&v=v1549866690836&size=normal&cb=lbd4671bcsub" width="304" height="78" role="presentation"
name="a-l5zeopcq88oa" frameborder="0" scrolling="no"...
JavaScript
const submit = HTMLFormElement.prototype.submit;
const $form = document.querySelector('#commentform');
$form.addEventListener('submit', (e) => {
e.preventDefault();
console.log('submit listener')
})
submit.call($form) // $form.submit is not a function