Side navigation
#4761 closed bug (duplicate)
Opened June 14, 2009 07:10AM UTC
Closed November 14, 2009 03:37PM UTC
hasClass() can't parse classes with newlines.
Reported by: | docwhat | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
hasClass() doesn't properly parse classes with newlines.
Here's a simple page to reproduce it.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html><body> <div id="div1" class="one two">buggy?</div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> <script type="text/javascript"> $(document).ready(function () { var el = $('div#div1'); if (el.hasClass('one')) { el.text('No bug! Yay!'); } else { el.text('The bug is present. Boo.'); } }); </script> </body></html>
This happens on IE only.