html - Make link submit identically to default button behavior -
Sorry if it seems redundant, I have read through a few posts and can not figure out how to be done. I need an element that behaves like a button, but I thought instead to use a CSS class object. I find out how to do this by creating However, due to server side software I am using I need to submit my form to duplicate the behavior of the button exactly. I have been guessed: Thank you for your help! You have the However, you should not use inline event delegation: HTML: JS: href = "#" and adding Javascript commands I
& lt; P & gt; & Lt; Input name = "test" type = "button" value = "click" /> & Lt; / P & gt;
& lt; P & gt; & Lt; One square = "button" href = "#" onclick = "submit ()" & gt; Click & lt; / A & gt; & Lt; / P & gt;
form in the context of the element, and then submit:
& lt; P & gt; & Lt; A class = "button" href = "#" onclick = "document.getElementById ('myFormId') presented ()" & gt; Click & lt; / A & gt; & Lt; / P & gt;
& lt; P & gt; & Lt; One class = "button" href = "#" id = "submit-anchor" & gt; Click & lt; / A & gt; & Lt; / P & gt;
document.getElementById ("submit-anchor"). addEventListener ("click", function () {document.getElementById ('myFormId'). Submit ();});
Comments
Post a Comment