|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "html" for Document
|
|
|
|
var doc = Document.parse("<div><p>A</p><p>B</p><p>C</p></div>")
|
|
|
|
var nodeList = doc.querySelectorAll("p")
|
|
var list = nodeList.toList
|
|
|
|
System.print(list.count) // expect: 3
|
|
System.print(list[0].textContent) // expect: A
|
|
System.print(list[1].textContent) // expect: B
|
|
System.print(list[2].textContent) // expect: C
|
|
|
|
System.print(list is List) // expect: true
|
|
|
|
var empty = doc.querySelectorAll(".none").toList
|
|
System.print(empty.count) // expect: 0
|
|
System.print(empty is List) // expect: true
|
|
|