JSFiddle - React, Tailwind, and code Playground
by int32_t
HTML
<p>Empty start page</p>
JavaScript
(function() {
var html = "<!DOCTYPE html>\n<html>\n<head>\n <title>Test page</title>\n</head>\n<body>\n\n<form action=\"/some/url\" method=\"post\">\n <input type=\"submit\" value=\"Send\" />\n</form>\n<pre id=console></pre>\n</body></html>";
document.addEventListener("DOMContentLoaded", function() {
var parsed_document = (new DOMParser).parseFromString(html, 'text/html');
document.documentElement.replaceChild(parsed_document.body, document.body);
document.getElementById('console').textContent = document.forms[0].action;
});
}).call(this);