Skip to main content

Bug Tracker

Side navigation

#7078 closed bug (duplicate)

Opened September 24, 2010 06:03PM UTC

Closed October 07, 2010 10:01PM UTC

Last modified March 13, 2012 10:22PM UTC

.find() cannot select nodes based on the inline style attribute

Reported by: adam.wulf Owned by:
Priority: low Milestone: 1.4.3
Component: selector Version: 1.4.1
Keywords: find style Cc:
Blocked by: Blocking:
Description

$content.find("[style*=color]") will never find any nodes, even if they have color defined in the inlien style.

I've uploaded an html file that reproduces the bug

Attachments (1)
  • bad_style_selector.html (1.0 KB) - added by adam.wulf September 24, 2010 06:04PM UTC.

    shows .find() not being able to select based on inline style

Change History (4)

Changed September 24, 2010 06:05PM UTC by adam.wulf comment:1

just to be exceptionally clear, this bug affects selecting any of the inline style, not just color. using the style attribute at all in the selector doesn't work. :)

Changed September 24, 2010 06:52PM UTC by snover comment:2

priority: highlow

This is only an issue in IE. All other browsers work fine. Live test case

That said, trying to select elements based on inline styles is an exceedingly horrible idea. You should almost certainly be using class names instead.

Changed September 26, 2010 11:25PM UTC by adam.wulf comment:3

I've updated the text case to show it also not working in Firefox and Safari. the problem is specific to the .find() method, as opposed to using jQuery(). Updated test case at: http://jsfiddle.net/qJdXW/1/

I'm trying to use jQuery to help clean up Word content that has been pasted into a tinymce editor. I need to be able to select based on inline styles, since the HTML it's inserting doesn't have classnames.

Thanks!

Changed October 07, 2010 10:01PM UTC by snover comment:4

resolution: → duplicate
status: newclosed

Duplicate of #3399.