Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get last element from div javascript

const app = document.getElementById('div');

 //assign last child to variable
let app_lastChild = app.lastChild; 

 //assign text from last child of element
let lastChild_text = app.lastChild.text;
 
PREVIOUS NEXT
Tagged: #element #div #javascript
ADD COMMENT
Topic
Name
5+5 =