|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "html" for Document
|
|
|
|
var doc = Document.parse("<div class='container main'>Content</div>")
|
|
|
|
var div = doc.querySelector("div")
|
|
System.print(div.className) // expect: container main
|
|
|
|
div.className = "box"
|
|
System.print(div.className) // expect: box
|
|
|
|
var noClass = Document.parse("<span>No Class</span>")
|
|
var span = noClass.querySelector("span")
|
|
System.print(span.className) // expect:
|
|
|
|
span.className = "highlight"
|
|
System.print(span.className) // expect: highlight
|
|
|
|
div.className = "one two three"
|
|
System.print(div.className) // expect: one two three
|
|
|