|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "html" for Document
|
|
|
|
var doc = Document.parse("<div id='test'>Content</div>")
|
|
|
|
var div = doc.querySelector("div")
|
|
|
|
System.print(div.nodeType) // expect: 1
|
|
System.print(div.nodeName) // expect: DIV
|
|
System.print(div.nodeValue == null) // expect: true
|
|
|
|
var text = doc.createTextNode("Text content")
|
|
System.print(text.nodeType) // expect: 3
|
|
System.print(text.nodeName) // expect: #text
|
|
System.print(text.nodeValue) // expect: Text content
|
|
|
|
text.nodeValue = "Changed"
|
|
System.print(text.nodeValue) // expect: Changed
|
|
|
|
var p = doc.createElement("p")
|
|
System.print(p.nodeType) // expect: 1
|
|
System.print(p.nodeName) // expect: P
|
|
|