I have a submit button for a form that is embedded without access to the field itself. That said I need to be able to run some javascript after the page loads to change the text from "Submit" to "Request Info". I do realize I could go into Marketo and change it but what it says depends on the page its loading on. I have already taken care of the part that waits until the page finishes loading and am just looking for the bit that updates the word Submit to Request Info.
HTML Button:
<button type="submit" class="mktoButton">Submit</button>
What I have so far (not working):
<script defer>
MktoForms2.whenReady(function(form){
document.getElementsByClassName("mktoButton").innerHTML = "Request Info";
});
</script>
I am still very green when it comes to JavaScript so if its an obvious issue thank you for not drilling me about it :) I do realize that this works when using ID's but Marketo does not add an ID to its Submit buttons.
I have added what was tried in the problem details to help drill down what I need.