Bug Tracker

Modify

Ticket #7078 (closed bug: duplicate)

Opened 3 years ago

Last modified 14 months ago

.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:
Blocking: Blocked by:

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

bad_style_selector.html Download (1.0 KB) - added by adam.wulf 3 years ago.
shows .find() not being able to select based on inline style

Change History

Changed 3 years ago by adam.wulf

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

comment:1 Changed 3 years ago by adam.wulf

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. :)

comment:2 Changed 3 years ago by snover

  • Priority changed from high to low

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.

comment:3 Changed 3 years ago by adam.wulf

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!

comment:4 Changed 3 years ago by snover

  • Status changed from new to closed
  • Resolution set to duplicate

Duplicate of #3399.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.