2024-09-07 23:17:56 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<script src="../include.js"></script>
|
|
|
|
|
<button formaction="http://www.example.com/"></button>
|
2024-09-07 23:27:33 +01:00
|
|
|
<input formaction="http://www.example.com/">
|
2024-09-07 23:17:56 +01:00
|
|
|
<script>
|
|
|
|
|
test(() => {
|
|
|
|
|
const elementNames = [
|
|
|
|
|
"button",
|
2024-09-07 23:27:33 +01:00
|
|
|
"input",
|
2024-09-07 23:17:56 +01:00
|
|
|
];
|
|
|
|
|
for (const elementName of elementNames) {
|
|
|
|
|
const element = document.querySelector(elementName);
|
|
|
|
|
println(`${elementName}.formAction initial value: ${element.formAction}`);
|
|
|
|
|
element.formAction = "";
|
|
|
|
|
println(`Final segment of ${elementName}.formAction after setting to the empty string: ${element.formAction.split('/').pop()}`);
|
|
|
|
|
element.formAction = "../test.html";
|
|
|
|
|
println(`Final segment of ${elementName}.formAction after setting to "../test.html": ${element.formAction.split('/').pop()}`);
|
|
|
|
|
element.remove();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|