在一个练习中,我在每次单击按钮后创建了一个新的元素li。它不起作用。在控制台中,它报告"li is not defined“。我做错什么了?button");const ul = document.querySelector("ul"); const li= document.createElement('li');
<
因此,我有一个边栏是从一个JavaScript函数创建的,我想添加一个onclick元素,该元素在单击li元素时被激活。这是我有的,但我不知道怎么改正。window.onload = function () { for (var obj in theArray) {
$('#theUl').append($("<lilocation.href': theArray[ob