Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript last child

let text = document.getElementById("mySelect").lastChild.text; // text of last child


// lastChild returns the list child node: An element node, a text node, or a comment node
//The lastElementChild property returns the last child element (ignores text and comment nodes).
 
PREVIOUS NEXT
Tagged: #javascript #child
ADD COMMENT
Topic
Name
3+1 =