Skip to main content

Bug Tracker

Side navigation

#14238 closed bug (notabug)

Opened August 09, 2013 07:34AM UTC

Closed August 09, 2013 12:23PM UTC

It consoles up to parent level.

Reported by: bharat20185@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:
Description

I used jQuery 1.10.2 i.e CDN url.

I have made "UL LI" tree view and make li clickable to get path but whenever I click on any LI dom it gives all DOM up to its parent. See below code I wrote.

<ul class="root">

<li>Root

<ul>

<li class="dir1">Dir 1

<ul>

<li>Sub Dir 1</li>

<li>Sub Dir 2</li>

</ul>

</li>

<li class="dir2">Dir 2

<ul>

<li>Sub Dir 1</li>

<li>Sub Dir 2</li>

</ul>

</li>

<li class="dir3">Dir 3

<ul>

<li>Sub Dir 1</li>

<li>Sub Dir 2</li>

</ul>

</li>

<li class="dir4">Dir 4</li>

</ul>

</li>

</ul>

<script>

$(document).ready(function () {

jQuery('li').click(function(obj){

console.log(obj);

})

});

</script>

Attachments (0)
Change History (1)

Changed August 09, 2013 12:23PM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

Event bubbling, learn it. Ask for help on a forum.