Bug Tracker

Opened 6 years ago

Closed 6 years ago

#12973 closed bug (notabug)

IE8: Selected elements may be lost when calling .text('string')

Reported by: bguertin@… Owned by: bguertin@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:

Description

In IE8, the value of: $('<span class="value">').text('text!').length is 0

In other browsers, $('<span class="value">').text('text!').length is 1

It works correctly if you do not specify a class, e.g. $('<span>').text('text!').length is 1 in all browsers

Change History (3)

comment:1 Changed 6 years ago by Rick Waldron

Owner: set to bguertin@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to begin.

comment:2 Changed 6 years ago by bguertin@…

Status: pendingnew

Whoops. You can close this bug. It is fixed in edge, but broken in the stable release. My bad

http://jsfiddle.net/AUSkN/

comment:3 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed

Close your span like the docs say to do.

Note: See TracTickets for help on using tickets.