Изучаю jQuery
. Хочу сделать так, чтобы при нажатии на the button
в список ul
добавлялся li
. Пробую делать так и не понимаю почему не работает:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<script src="jquery-1.10.2.js"></script>
<script>
$(document).ready(function () {
$("#superButton").on("click", addLiToUl);
function addLiToUl() {
$("p > ul").append("<li>Hello!</li>");
}
});
</script>
</head>
<body>
<p>
<ul> Some things:</ul>
</p>
<input id="superButton" type="button" value="the button"/>
</body>
</html>