<!DOCTYPE html>
<html>
<body>
<div id="bbtop"></div>
<div id="bbdefine"></div>
<ul class="dl-submenu">
<li><a>AAAAA</a></li>
<li><a>BBBBB</a></li>
<li><a>test</a></li>
<li><a>w3cschool.cn</a></li>
</ul>
<script>
var bbdefine = document.getElementById('bbtop');
var elems = document.querySelectorAll('.dl-submenu li a');
for (var i=0; i<elems.length; ++i) {
elems[i].addEventListener('click', clickFunc);
}
function clickFunc(event) {
bbdefine.textContent = this.textContent+' Capacitor';
}
</script>
</body>
</html>
The code above is rendered as follows: