• I’m working on a site that got flagged for not being 508 compliant. This plugin was flagged for “All onclick handlers should have an equivalent onkeyup or onkeydown handler.” Related W3C page is here: https://www.w3.org/TR/WCAG20-TECHS/F54.html

    The line that caused the issue is function lazyLoadThumb(e){var t='<img loading="lazy" data-lazy-src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360"><noscript><img src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360"></noscript>',a='<div class="play"></div>';return t.replace("ID",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement("iframe"),t="https://www.youtube.com/embed/ID?autoplay=1";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute("src",t.replace("ID",this.dataset.id)),e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","1"),e.setAttribute("allow", "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),this.parentNode.replaceChild(e,this)}document.addEventListener("DOMContentLoaded",function(){var e,t,a=document.getElementsByClassName("rll-youtube-player");for(t=0;t<a.length;t++)e=document.createElement("div"),e.setAttribute("data-id",a[t].dataset.id),e.setAttribute("data-query", a[t].dataset.query),e.innerHTML=lazyLoadThumb(a[t].dataset.id),e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)});

    The last part of the line e.onclick=lazyLoadYoutubeIframe,a[t].appendChild(e)}); looks like the offending code.

    Will there be an update that will add “onkeyup” or “onkeydown” functionality in addition to the “onclick”?

    Thanks!

  • The topic ‘All onclick handlers should have an equivalent onkeyup or onkeydown handler.’ is closed to new replies.