I'm using a plugin (so I do not have access to edit HTML) for an age verification pop-up on my website. I want to change the text displayed on each of the two buttons, which is currently being pulled from the HTML value attribute.
This is the HTML for each button:
<input type="button" name="confirm_age" id="confirm_age" value="I am 18 or older [Enter Site]" style="background-color:#2dc937; width:300px;" tabindex="1">
<input type="button" name="not_confirm_age" id="not_confirm_age" value="I am under 18" style="background-color:#cc3232; width:300px;" tabindex="1">
As @vanblart said you can use:
document.querySelector("#confirm_age").value = "New Value"
If the plugin takes its time to render the buttons you can wrap the above code in a timer with setTimeout():
setTimeout(function() {
document.querySelector("#confirm_age").value = "New Value"
}, 2000);