Skip to content

Instantly share code, notes, and snippets.

@vvmk
Created July 22, 2022 18:27
Show Gist options
  • Select an option

  • Save vvmk/34dc40f156878c8fc12b18d18482cce7 to your computer and use it in GitHub Desktop.

Select an option

Save vvmk/34dc40f156878c8fc12b18d18482cce7 to your computer and use it in GitHub Desktop.
// set these three first
// intended for use with sr-only class found here https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
let targetClass = 'jkit-video-popup-btn';
let linkText = 'play video';
let classList = 'sr-only';
let childSpan = document.createElement('span');
childSpan.innerHTML = linkText;
childSpan.className = classList;
let parentLink = document.getElementsByClassName(targetClass)[0];
parentLink.appendChild(childSpan);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment