first child element javascript
Both these will give you the first child node:
console.log(parentElement.firstChild); // or
console.log(parentElement.childNodes[0]);
If you need the first child that is an element node then use:
console.log(parentElement.children[0]);
Also in JavaScript:
- ternaire javascript
- document.querySelector
- javascript check if is object
- javascript draw circle on canvas
- how to store variable in javascript
- set port in react app
- tolowercase
- autocomplete typeahead ajax
- clearing cookie in js
- useBootstrapPrefixhttp://localhost:8000/static/js/bundle.js:15261:75
- javascript toFixed
- json vs gson
- Exception in thread "main" org.openqa.selenium.JavascriptException: cannot read getPlayerState
- latest react version npm
- sequelize create record with foreign key constraint
- react router dom
- react window navigate
- nodemailer
- multiple event with javascript
- javascript remove property from object
- javascript add row to table
- click point invert zoom react simple map
- shuffle array javascript
- js get url parameter