Creative Use of the JQuery Selector. Why can this even work ?
Hi,
On our current project we had an very unexpierenced coworker which wroted an "a" tag as an jquery selector. to better understand what he did see the following working sample:
- <html>
<head>
<script type="text/javascript" src="
http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
<script language="javascript">
alert($('<a href="#foobar" id="foobar" rel="relfoo">').attr('id'));
</script>
</body>
</html>
This works in Firefox but not in IE (of course not :-) .
Yeah we know its wrong, but we dont find a reason for its working in firefox ! can someone explain why this can even work ?
TIA
Rufinus