|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "html" for Document
|
|
|
|
var doc = Document.parse("<div><p>A</p><p>B</p><p>C</p></div>")
|
|
|
|
var list = doc.querySelectorAll("p")
|
|
|
|
System.print(list.item(0).textContent) // expect: A
|
|
System.print(list.item(1).textContent) // expect: B
|
|
System.print(list.item(2).textContent) // expect: C
|
|
|
|
System.print(list.item(0).tagName) // expect: P
|
|
System.print(list.item(1).tagName) // expect: P
|
|
System.print(list.item(2).tagName) // expect: P
|
|
|
|
var single = doc.querySelectorAll("div")
|
|
System.print(single.item(0).tagName) // expect: DIV
|
|
|