console
let ul=document.createElement('ul');
document.body.appendChild(ul);
let text2=['手机','电视','笔记本','家电','路由器','智能硬件']
let net=['http://jsrun.net/dHaKp/edit','http://jsrun.net/5dIKp/edit']
for(var i=0;i<text2.length;i++){
let li= document.createElement('li');
ul.appendChild(li);
let a= document.createElement('a');
li.appendChild(a);
let href=document.createAttribute('href');
href.value=net;
a.setAttributeNode(href);
let text=document.createTextNode(text2[i]);
a.appendChild(text);
let style=document.createAttribute('style');
style.value='list-style-type:none ;float: left ;padding: 28px 60px;background-color: skyblue ;'
li.setAttributeNode(style);
let style2=document.createAttribute('style');
style2.value='text-decoration: none;color: #fff;';
a.setAttributeNode(style2);
}
<body>
</body>