I am having trouble wrapping my head around getting Perl to work with HTML. I am trying to do something I think is simple, but I cant find anything like it online.
Let's say I have a blank web page that has only a button labeled new, and when I press it, I want to destroy the button and create two new buttons, one that is a submit button, and one cancel that creates the old new button.
How would I go about doing that, without reloading the page?
From my understanding, the original HTML code would look something like this.
<form action="/cgi-bin/switchButtons.cgi" method="POST">
<input type="button" value="new">
</form>
and afterward should look like this.
<form action="/cgi-bin/switchButtons.cgi" method="POST">
<input type="submit" value="submit">
<input type="button" value="cancel">
</form>
On pressing cancel, it should refer back to the first snippet.