Pointer-events: nobody works in IE

I am trying to disable hyperlinks on a SharePoint SharePoint list editing page. I used the content editor web part and placed pointer-events : none . It works fine in Google Chrome, but doesn't work in IE. Is there an alternative to this? I just want to use CSS. My IE is version 10.

+5
source share
1 answer

pointer-events not supported in IE 10, and there is no other similar CSS property.

To solve this problem, you must either change the markup, or use a script.

Update

Here is an example using a script.

I also created a link, so you can’t see them as links that you can use alone, based on the fact that someone accidentally clicks in the text and accidentally hits one, it will still be fine.

 Array.prototype.slice.call(document.querySelectorAll("a")).forEach(function(link) { link.addEventListener("click", function(e) { e.preventDefault(); }); }); 
 a { cursor: text; text-decoration: none; color: inherit; } 
 Some text with <a href="http://stackoverflow.com"> a link </a> to click on 

Update 2

There are actually 2 posts here that have several ways to do this (all script though one)

where this answer does not use a script.


Update 3 Based on Comment

To use the disabled='disabled' attribute, you must either add it to the server side so that the anchor looks like this: <a href="link" disabled="disabled">Link</a> or a client side with a script like this

 Array.prototype.slice.call(document.querySelectorAll("a")).forEach(function(link) { link.setAttribute('disabled', 'disabled'); }); 
 /* a { cursor: text; text-decoration: none; color: inherit; } */ 
 Some text with <a href="http://stackoverflow.com"> a link </a> to click on 
+1
source

Source: https://habr.com/ru/post/1244717/


All Articles