Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: jsdom
node v11.15.0
version:
master
endpoint
share
tweet
const { JSDOM } = require("jsdom"); var jsDomDoc = new JSDOM(`<!doctype html><html><head><title>some doc</title></head> <body><div id="my-div" /></body></html>`); var document = jsDomDoc.window.document; var elem = document.getElementById("my-div"); console.log(elem); //returns null
Created from: https://npm.runkit.com/jsdom
Loading…
no comments
sign in
to comment