Returns -1, as there is no element with ID foobar.
Edit code and click me
Your Result
(Some examples do not work in Google Chrome):
foo
bar
baz
Edit the code above and click to see the result
www.xhtml.co.il
- Try it yourself