Bug Tracker

Opened 9 years ago

Closed 9 years ago

#7550 closed bug (invalid)

Different results of html() function in different browsers

Reported by: krishnafru Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

I am facing a problem with html function. below is the code snippet:

<div id="div_container">
    <input type="text" id="txt_name" value="sample text" style="width:250px;" />
</div>

Suppose later user changed the txt_name value from "sample text" to "changed text".

Now if i call

alert($('#div_container').html());

in IE the alert window shows

<input type="text" id="txt_name" value="changed text" style="width:250px;" />

but in FF

<input type="text" id="txt_name" value="sample text" style="width:250px;" />

Change History (1)

comment:1 Changed 9 years ago by jitter

Resolution: invalid
Status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug ticket!

The documentation states:

This method uses the browser's innerHTML property. Some browsers may not return HTML that exactly replicates the HTML source in an original document.

As IE does in this case. IE seems to change the innerHTML although this shouldn't be the case.

Last edited 9 years ago by jitter (previous) (diff)
Note: See TracTickets for help on using tickets.