|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "html" for Document
|
|
|
|
var doc = Document.parse("<div id='container'></div>")
|
|
var container = doc.getElementById("container")
|
|
|
|
var text = doc.createTextNode("Hello World")
|
|
|
|
System.print(text.textContent) // expect: Hello World
|
|
System.print(text.nodeType) // expect: 3
|
|
System.print(text.nodeName) // expect: #text
|
|
System.print(text.nodeValue) // expect: Hello World
|
|
|
|
text.textContent = "Changed content"
|
|
System.print(text.textContent) // expect: Changed content
|
|
|
|
text.nodeValue = "Another change"
|
|
System.print(text.nodeValue) // expect: Another change
|
|
System.print(text.textContent) // expect: Another change
|
|
|
|
container.appendChild(text)
|
|
System.print(text.parentNode != null) // expect: true
|
|
System.print(text.parentElement.tagName) // expect: DIV
|
|
|