Hi all,
I have a text box. When users press enter, it triggers the submit function:
commentContent.keydown(function(e){
if(commentContent.is(":focus") && (e.keyCode || e.which) == 13 && !e.shiftKey)
{
e.preventDefault();
commentForm.submit();
}
});
This then prepends the content of the text box into the HTML.
commentsHere.prepend(commentData);
However, when I search for this new element by id and class, it doesn't register. Do I need to tell JS to refresh the DOM so I can find it? I have read some discussions about using .on(), does that mean I need to register an event to listen for prepend events??