<div tabindex="0" class="without-focus-within">
  Some stuff!
  <a href="https://google.com" class="deal-with-focus-with-javascript">Link here</a>
</div>

<div tabindex="0" class="with-focus-within">
  Some stuff!
  <a href="https://google.com">Link here</a>
</div>
div {
  padding: 30px;
  background: #eee;
  opacity: 0;
}

div.without-focus-within:hover,
div.without-focus-within:focus,
div.without-focus-within.focus {
  opacity: 1;
}

div.with-focus-within:hover,
div.with-focus-within:focus,
div.with-focus-within:focus-within {
  opacity: 1;
}

body {
  padding: 2rem;
}
var link = document.querySelector(".deal-with-focus-with-javascript");

link.addEventListener("focus", function() {
  link.parentElement.classList.add("focus");
});
link.addEventListener("blur", function() {
  link.parentElement.classList.remove("focus");
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.