Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#5807 closed bug (fixed)

Well-formed markup unneeded for single tags

Reported by: SidneySM Owned by:
Priority: major Milestone:
Component: docs Version:
Keywords: Cc:
Blocked by: Blocking:


The documentation at <http://api.jquery.com/jQuery/#jQuery2> goes into great detail describing that well-formed snippets must be passed to jQuery(), even in the case of single tags.

This appears to go against what most users do, and against jQuery itself (since input's just parsed by a regexp, there's no difference between $('<div>'), $('<div/>'), and $('<div></div>')).

To avoid making the next generation of jQuery users think about elements in terms of opening and closing tags (which is training to see the document as markup rather than a DOM), could the documentation be amended to clarify that this only matters when the snippet contains nested tags?

Change History (3)

comment:1 Changed 13 years ago by dmethvin

Resolution: fixed
Status: newclosed

I've tried to clarify it a bit, if you think it still needs work add a comment on the docs page and we'll get to it.

comment:2 Changed 12 years ago by Rick Waldron

Blocking: 4705 added

comment:3 Changed 12 years ago by jitter

Blocking: 4705 removed
Version: 1.4
Note: See TracTickets for help on using tickets.