Skip to main content

Search and Top Navigation

#11396 closed bug (notabug)

Opened March 09, 2015 01:09PM UTC

Closed March 09, 2015 02:32PM UTC

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())

Attachments (0)
Change History (2)

Changed March 09, 2015 01:13PM UTC by martin comment:1

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

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

Changed March 09, 2015 02:32PM UTC by scottgonzalez comment:2

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.