The difference between $("<tag></tag>")
and $("<tag>")
and $("<tag />")
is personal style/preference (unless you're using IE, apparently. see comment). All three will use the native createElement()
method to create a now DOM element. If the tags have parameters it will parse them create the element by some other means.
More info on creating things here: http://api.jquery.com/jQuery/#jQuery2
To select elements by id, you'd use $("#idName")
.
To select existing elements by tag name, $("tag")
.
To select existing elements by class name, $(".className")
.
More info on selecting things here: http://api.jquery.com/jQuery/#jQuery1