Pre-checked checkbox landing page
Hi
I'm creating a landing page for unsubscribe and what it shou;d do:
When opening the landing page, the checkbox for the option 'unsubscribe' should be automatically checked so that the user does not have to do this anymore. I'm trying to get this result with a script, but it's not working.
Script:
<script>
window.addEventListener('lpRuntimeReady',function(e){
init(e.detail)
}
function init(lpRuntime){
window.getElementByTagName('acr-form-checkbox-4').checked = true;
})
</script>
I'm adding this at the top of my landing page with an html content. Can someone help me and let me know what I'm doing wrong?
Thank you!
Kr
Lara