-1

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)" ?

MSoulja
  • 1
  • 1
  • Possible duplicate of [How to disable HTML button using JavaScript?](https://stackoverflow.com/questions/3014649/how-to-disable-html-button-using-javascript) – Jorge Fuentes González Oct 27 '18 at 15:39
  • Your button is not a `
    – Jorge Fuentes González Oct 27 '18 at 15:41
  • @AlonEitan cut OP some slack - it's a new contributor. And, in fairness, way to post code is not super well designed - you have inline code samples and code blocks and the two function completely differently. It's quite understandable why they are frequently misused. As existing members we have the tools to help and we're expected to. You yourself could have edited the question and formatted the code in about the same time it took to write that comment. – VLAZ Oct 27 '18 at 15:42
  • 1
    @vlaz You have a code editor to create a working snippet, what more would you need? I tried to take a look at the question, it had like a million classes and attributes so I didn't want to do it myself. It's first of all the OP's responsibility – Alon Eitan Oct 27 '18 at 15:45
  • @AlonEitan and a person who registered *today* is supposed to be completely familiar with every posting option available? And the way to guide them is to be cross with them instead of *showing* how it's done? We are on a Q&A site where the community is expected to not only answer but help out improving questions. I thought you should be familiar with that and yet here we are. – VLAZ Oct 27 '18 at 15:55