<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<ul>
<li id="bj" value="beijing">
北京
<p>海淀</p>
奥运
</li>
<li id="sh" value="shanghai" >上海</li>
</ul>
<script>
var A=document.getElementById("bj");
var C=document.getElementsByTagName("p");
alert(A.firstChild.nodeValue+C.firstChild.nodeValue+A.lastChild.nodeValue);
</script>
</body>
</html>