Bug Tracker

Modify

Ticket #12142 (closed bug: invalid)

Opened 10 months ago

Last modified 9 months ago

选择器错误

Reported by: wangy567@… Owned by:
Priority: low Milestone: None
Component: selector Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

<ul><li style="cursor:pointer;" onclick="GetNodes(this,event)" value="1" >开发部<ul><li style="cursor:pointer;" onclick="GetNodes(this,event)" value="4" >研发一部<ul><li style="cursor:pointer;" onclick="GetNodes(this,event)" value="42" >研发一部-1-1</li></ul></li><li style="cursor:pointer;" onclick="GetNodes(this,event)" value="5" >研发二部<ul><li style="cursor:pointer;" onclick="GetNodes(this,event)" value="28" >研发二部1</li></ul></li><li style="cursor:pointer;" onclick="GetNodes(this,event)" value="47" >开发三部<ul><li style="cursor:pointer;" onclick="GetNodes(this,event)" value="49" >开发三部_2</li></ul></li></ul></li></ul>

上面的代码是我的测试代码。

$("li [value=1]") 不能获取到我要的节点信息 返回值是null 除了value=1以外的节点信息都可以正常获取 我工作的时候用的是1.4.2版本,我测试过1.7.2 也存在这个问题。希望你们能够及时解决这个bug。谢谢。

Change History

comment:1 Changed 9 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to selector

There shouldn't be a space with the tag name and the attribute selector. Try this $("li[value=1]")

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.