I've searched stackoverflow and gone through many pages deep in google. Nothing helped me to disable my button. So I come here wishing someone can help me.
Here's the button I'm trying to disable.
EDIT: This is different than the surposed dublicate as you said yourself, this is a div with a link and not a button.
<div class="de elBTN elAlign_center elMargin0 ui-droppable de-editable" id="button-80437" data-de-type="button" data-de-editing="false" data-title="button" data-ce="false" data-trigger="none" data-animate="fade" data-delay="500" style="margin-top: 30px; outline: currentcolor none medium; cursor: pointer; display: block;" data-elbuttontype="2" aria-disabled="false" data-element-theme="customized">
<a href="#" class="elButton elButtonSize1 elButtonColor1 elButtonRounded elButtonPadding2 elButtonCorner3 elBtnHP_25 elBTN_b_1 elBTNone elButtonBlock elButtonFull elBtnVP_5 elButtonShadow5 elButtonTxtColor1 de1pxLetterSpacing no-button-effect" style="color: rgb(255, 255, 255); background: rgb(1, 116, 199);; font-size: 20px;" data-show-button-ids="tmp_paragraph-42317,headline-29302" data-hide-button-ids="headline-71892,button-80437" id="undefined-503">
<span class="elButtonMain">YES</span>
<span class="elButtonSub" style="font-size: 14px;">I Understand</span>
</a>
</div>
This is what I'm trying to do.
ver = iOSversion();
if (ver[0] <= 11.4) {
alert('Your OS is below 11.4, please use a different device.');
document.getElementById('button-80437').disabled = true;
}
function disableEnable(elems, isDisabled){
for(var i = elems.length-1;i>=0;i++) {
elems[i].disabled = isDisabled;
}
}
tried with these aswell.. nothing.
var div = document.getElementsById("button-80437");
disableEnable(div.getElementsByTagName("button"), true);
EDIT: Thanks for your answers. I appreciate it. Unfortunatly there isn't much I can do to change it to a button as its made using a wysiwyg "clickfunnels".
Maybe I could do this instead.
How do I disable a href link in JavaScript?
Inject href="javascript: void(0)" ?