I have a javascript function meant to append the contents of a text field to a list, in order to make it render as soon as the user clicks a button next to the text field. The button and text field show up fine, but I've been told that I need to convert my function to JQuery, whose syntax I'm far less familiar with than javascript. This is the function:
document.getElementById("append").onclick = function()
{
var text = document.getElementById("new-text").value;
var li = "<li>" + text + "</li>";
document.getElementById("list").appendChild(li);
}
list is the list I want to append the text field contents to, and new-text is the id for the text field content.