Created
July 18, 2020 13:10
-
-
Save avallete/895d73275ca77c02922a9a3160e8c477 to your computer and use it in GitHub Desktop.
A quick test to retrieve the '#hoverme' div nodeId trough CDP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Shadow DOM Fixture</title> | |
| </head> | |
| <body> | |
| <div id="host"></div> | |
| <script> | |
| document | |
| .getElementById('host') | |
| .attachShadow({mode: 'open'}) | |
| .innerHTML = ` | |
| <style> | |
| .shadow-button { | |
| height: 100px; | |
| width: 100px; | |
| background-color: blue; | |
| } | |
| .shadow-button:hover { | |
| background-color: red; | |
| } | |
| </style> | |
| <div id="hoverme" class="shadow-button">SHADOW DOM</div> | |
| `; | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment