Opened 4 years ago

Closed 4 years ago

#11396 closed bug (notabug)

html() function does not return correct html for legacy created html strings

Reported by: martin Owned by:
Priority: minor Milestone: none
Component: ui.core Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:

Description

According the HTML spec the disabled option being set is 'disabled="disabled"'

In old HTML and also as produced by some browsers direct innerHTML, and also anything that may be retrieved having been stored in a database or old email you can acquire strings like '<DIV><INPUT DISABLED></DIV>' not capitalised and no value for the disabled attribute.

My own html cleaner can sort this

$(ydrDynamicLoad.load("cleanser").xhtml("<DIV><INPUT DISABLED></DIV>").doc).html() "<div><input disabled="disabled"></div>"

If you put this direct into $ you get a wrong solution - the input tag is not closed and the disabled attribute has the incorrect value "" rather than disabled

$("<DIV><INPUT DISABLED></DIV>").ydr_outerHTML() "<div><input disabled=""></div>"

(Note ydr_outerHTML is my own widget that adds an outer element and then calls .html())

Change History (2)

comment:1 Changed 4 years ago by martin

Note my typo - correct html has a / et the end of input

<div><input disabled="disabled"/></div>

comment:2 Changed 4 years ago by Scott González

Resolution: notabug
Status: newclosed

This has nothing to do with jQuery UI. The jQuery Core bug tracker is at http://github.com/jquery/jquery/issues, though you should use the forums or Stack Overflow for help since this is not a bug.

Note: See TracTickets for help on using tickets.