Skip to main content

Bug Tracker

Side navigation

#5807 closed bug (fixed)

Opened January 15, 2010 12:27AM UTC

Closed January 15, 2010 01:51AM UTC

Last modified February 05, 2011 01:13AM UTC

Well-formed markup unneeded for single tags

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

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?

Attachments (0)
Change History (3)

Changed January 15, 2010 01:51AM UTC by dmethvin comment:1

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.

Changed December 01, 2010 03:03PM UTC by rwaldron comment:2

blocking: → 4705

Changed February 05, 2011 01:13AM UTC by jitter comment:3

blocking: 4705
version: 1.4