Bug Tracker

Ticket #4817: hasClass-test.html

File hasClass-test.html, 757 bytes (added by sixtease, 10 years ago)

test

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<title>hasClass metacharacters test case</title>
5<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
6<script type="text/javascript" src="http://www.google.com/jsapi"></script>
7<script type="text/javascript">google.load("jquery", "1")</script>
8</head>
9<body>
10
11    <div id="dotclass" class="has.dot"></div>
12   
13    <script>
14        if ( $('#dotclass').hasClass('has.dot') ) alert('works');
15        else alert('fails');
16        if ( $('#dotclass').hasClass('has\\.dot') ) alert('works with \\\\');
17        else alert("doesn't work with \\\\ (OK)");
18    </script>
19
20</body>
21</html>