jQuery document.createElement equivalent

I’m refactoring some old JavaScript code and there’s a lot of DOM manipulation going on.

  I would like to know if there is a better way to do this using jQuery. I’ve been experimenting with:

But I’m […]

event.preventDefault() vs. return false

When I want to prevent other event handlers from executing after a certain event is fired, I can use one of two techniques. I’ll use jQuery in the examples, but this applies to plain-JS as well: 1. event.preventDefault()

2. return false […]