I am learning jQuery . I want to make it so that when I click on the button , li added to the ul list. I try to do it and do not understand why it does not work:
<!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>