Skip to main content

Bug Tracker

Side navigation

#12973 closed bug (notabug)

Opened November 27, 2012 11:34PM UTC

Closed November 27, 2012 11:41PM UTC

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

Reported by: bguertin@relayrides.com Owned by: bguertin@relayrides.com
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

Attachments (0)
Change History (3)

Changed November 27, 2012 11:37PM UTC by rwaldron comment:1

owner: → bguertin@relayrides.com
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.

Changed November 27, 2012 11:40PM UTC by bguertin@relayrides.com comment:2

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/

Changed November 27, 2012 11:41PM UTC by dmethvin comment:3

resolution: → notabug
status: newclosed

Close your span like the docs say to do.