When JavaScript is cool…

JavaScripting Add comments

This is really cool especially for me old dhtml dude/today XSLT dude (and seems like AJAX dude tomorrow).

$(”ul#menu>li[ul] a.active”).toggle(function(){}

So, what is going on above? I am writing CSS selectors combined with XPath to target specific elements. Library that makes this all possible is called jQuery

XPath is a part of a part of it’s jQuery expression language together with CSS.
jQuery is really worth of checking out.

2 Responses to “When JavaScript is cool…”

  1. Felix Geisendörfer Says:

    Err, I think you are using CSS selectors in your example. XPath’s look like this:

    /html/p/a/…

  2. jp Says:

    Yeah, good point, you are right that’s mainly css selectors except li[ul] part.

Leave a Reply

Check Spelling
Activate Spell Check while Typing
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in