firstElementChild
firstChild
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
window.onload=function(){
var x = document.getElementById('ul1')
if(x.firstElementChild){
x.firstElementChild.style.background='red';
}else{
x.firstChild.style.background='red';
}
}
</script>
<title>无标题文档</title>
</head>
<div id="ul1">
<li>111</li>
<li>222</li>
<li>333</li>
</div>
<body>
</body>
</html>