blob: 3dd2b4bd9cae33656dad8892ace230048b5cde8a [file] [log] [blame]
<!DOCTYPE HTML>
<html class="focus-within">
<head>
<style>
* {
border: none;
}
.focus-within {
border: 2px solid green;
}
</style>
</head>
<body class="focus-within">
<div id="root" class="focus-within">
</div>
<script>
let rootElement = document.getElementById('root');
let firstRoot = rootElement.attachShadow({mode: 'closed'});
let insideDiv = document.createElement("div");
insideDiv.innerText = "Foobar";
insideDiv.className = "focus-within";
let inputElement = document.createElement("input")
inputElement.className = "focus-within";
insideDiv.appendChild(inputElement);
firstRoot.appendChild(insideDiv);
inputElement.focus();
</script>
</body>
</html>