SharePoint Asked by Akshay Belure on December 28, 2021
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.
I tested your code in a spfx extension and it works well in IE, the click event get triggered.
Test demo:
BR
Answered by Baker_Kong on December 28, 2021
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');
});
}
Answered by Prasanna Ruwangana on December 28, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP