📜  javascript 添加导航栏链接 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:34.942000             🧑  作者: Mango

代码示例1
var link = document.createElement('a');
link.classList.add('menu__link');
link.href = '#section1';
link.textContent = 'Section 1';
document.getElementById('navbar__list').appendChild(link);