Bug Tracker

Modify

Ticket #3150 (closed bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

Attribute selectors attributeEquals, attributeStartsWith, attributeHas don't work

Reported by: aakoch Owned by:
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: Cc:
Blocking: Blocked by:

Description

Link elements aren't matched when the onclick attribute value is searched. An exception is thrown in some cases.

Here's some output from my test: link NOT found using selector "a[onclick=bar()]" link NOT found using selector "a[onclick='bar()']" exception caught using selector "a[onclick*=bar]" - TypeError: z.indexOf is not a function exception caught using selector "a[onclick*='bar']" - TypeError: z.indexOf is not a function

Attachments

temp.html Download (1.5 KB) - added by aakoch 5 years ago.
File to test attribute selection

Change History

Changed 5 years ago by aakoch

File to test attribute selection

comment:1 Changed 5 years ago by flesler

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

This was asked before. Inline event handlers are not good practices, and we provide a clean way of binding events unobstrusively.

Retrieving them as attributes has different side effects among the browsers. IE returns functions, while FF strings. So, IE is likely to cause unexpected behaviors when these approaches.

Try to refactor your code instead. Use a class or unobstrusive binding.

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.