Skip to main content

Bug Tracker

Side navigation

Ticket #4817: hasClass-test.html


File hasClass-test.html, 0.7 KB (added by sixtease, June 25, 2009 09:41AM UTC)

test

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>hasClass metacharacters test case</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1")</script>
</head>
<body>

    <div id="dotclass" class="has.dot"></div>
    
    <script>
        if ( $('#dotclass').hasClass('has.dot') ) alert('works');
        else alert('fails');
        if ( $('#dotclass').hasClass('has\\.dot') ) alert('works with \\\\');
        else alert("doesn't work with \\\\ (OK)");
    </script>

</body>
</html>

Download in other formats:

Original Format