Mulled this around a bit. jQuery does not give simple selectors
(though perhaps some plugins do) for text nodes. However, you can
create your own function which iterates and finds text nodes, see:
http://groups.google.com/group/jquery-en/browse_thread/thread/ee88f95eb53823d1/45d241d82d9f0081?l
Just tried to add a click event to a text node: it doesn't really
work. The event gets added, but can not be triggered by clicking.
(You can trigger it via jQuery.)
So, I suspect you will have to wrap the text nodes between headers, as
you mentioned. That will be a hassle, though, if they have
oliver wrote:
I think you will need to wrap the paragraphs in some
tag, or or something else.
This approach seems the most doable -- I'd have to wrap the elements
with jQ. Essentially I'd want to wrap all DOM elements between headers
in a div tag.
Anyone have suggestions of other more e
oliver wrote:
I think 'previous sibling' is a good term for the element you are
trying to find.
Sibling is probably the right term.
If you put a click handler on the parent of the paragraphs and the
headers, and click on one of the paragraphs, the event.target is that
parent object. I thin
I think 'previous sibling' is a good term for the element you are
trying to find.
If you put a click handler on the parent of the paragraphs and the
headers, and click on one of the paragraphs, the event.target is that
parent object. I think you will need to wrap the paragraphs in some
tag, or
5 matches
Mail list logo