afridy — 2013-05-11T11:50:00-04:00 — #1
i have a div dynamically created on page load using php. the id is 'A'.
When click on 'A' , another div is shown. Name is 'B'. this div is a child div of 'A'.
now 'B' div has onclick hide('B').
But when i click it does not hide itself. strage. but if i put another element name for example 'A', Then it works.
why 'B' is not hiding itself while it hideS any other element on that page including it's parent 'A'?
pullo — 2013-05-11T12:20:10-04:00 — #2
Can you post a link to a page where I can see this not working?
afridy — 2013-05-11T13:39:27-04:00 — #3
i just pm'd you the link pullo..
pullo — 2013-05-11T13:50:45-04:00 — #4
the problem is the id attribute.
<div class="marker" id="1marker" onclick="hide('1marker')"></div>
An id may not begin with a number. Change it to id="markerOne" or something similar.
afridy — 2013-05-12T01:24:40-04:00 — #5
Just tried by putting the number to back, but result is same :rolleyes:
any way, now i do not require it be hidden on click. the plan is bit changed.
pullo — 2013-05-12T03:26:11-04:00 — #6
This will definitely work as expected:
<div class="marker" id="marker" onclick="hide('marker')">Click me to hide</div>
so I guess there was something else going on.
afridy — 2013-05-12T08:46:00-04:00 — #7
JQUERY LIVE CLICK was hiding finally
Thank Pulli for your valuable time!