passing Number(0) to html fails.
|Reported by:||Morgan||Owned by:||flesler|
From the jquery-en mailing.
When I call html(5) it will set the innerHtml of my element(s) to "5". However, zero seems to work differently. When I call html(0), it removes the contents of my element(s) and does not append anything. I had hoped after a call to html(0), that html() would return "0".
Is this the expected behavior, or is this a bug?
I tracked it down to the clean function. On line 946 there is if(!elem), which fails with zero.
if(!elem && elem !== 0)
Change History (4)
comment:1 Changed 8 years ago by flesler
- need changed from Review to Commit
- Owner set to flesler
- Priority changed from major to minor
- Status changed from new to assigned
comment:2 Changed 8 years ago by flesler
- Resolution set to fixed
- Status changed from assigned to closed