0

I have created one spfx extension of type application customizer. I have attached click event to setting icon span.But when I click on setting icon it does not get fired.

This is working fine in Chrome, Firefox,IE edge but not working in IE 11,

Following is the code..

 const settingIcon = document.getElementsByClassName(SETTINGS_ICON)[0];
  if (settingIcon != null) {
    settingIcon.addEventListener("click", ()=> {
    alert('Hi')            
  });

Thank you.

  • Hello, maybe provide a screenshot of your console in IE? that would help us solve your case :) – Dos.Dejados Jul 27 at 10:40
1

I tested your code in a spfx extension and it works well in IE, the click event get triggered.

enter image description here

Test demo:

BR

| improve this answer | |
0

IE11 doesn't support arrow functions. Use function instead.

var settingIcon = document.getElementsByClassName(SETTINGS_ICON)[0];

if (settingIcon != null) {
  settingIcon.addEventListener("click", function () {
    alert('Hi');
  });
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.