Bug Tracker

Modify

Ticket #1972 (closed bug: worksforme)

Opened 5 years ago

Last modified 5 years ago

I can not catch element if there is "[", "]" symbols in id. example: alert($jq('#i[4]').attr('id'));

Reported by: phoenix Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by davidserduke) (diff)

I can not catch element if there is "[", "]" symbols in id. example: alert($jq('#i[4]').attr('id'));

but I can catch such elements by getElementById function.

Change History

comment:1 Changed 5 years ago by davidserduke

  • Status changed from new to closed
  • Resolution set to worksforme
  • Description modified (diff)

That is because those are reserved characters for the jQuery system. To use them you have to escape them with backslashes. Read here for more.

 http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F

See the example in the wiki also.

 http://docs.jquery.com/Selectors/id

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.