Consider the JavaScript below:
var v; if (this.children.length > 0) { v = this.firstElementChild.value; }
This works in modern versions