hello all. I need some help in understanding XPath selection in JQuery: i.e. i have this html code: <html> <head> <script language='javascript' src='jquery.js'></script> <script language='javascript'> function f() { alert($('//body/div')); } </script> </head> <body onload='f()'> <div id='1'> <div id='2'> aa </div> </div> </body> </html>
after loading this page, firebug throws: exception uncaught exception: Syntax error, unrecognized expression: // body/div when i changed selector syntax to $("//body/div[id='1']") it returnes div with id 1 i'll be appreciate for any help! thnx