Bug Tracker

Ticket #5159: selector_test.html

File selector_test.html, 1.1 KB (added by SpadXIII, 13 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="content-type" content="text/html; charset=utf-8" />
5<title>Test jQuery selector/live-event bug</title>
6<script type="text/javascript" src="jquery-1.3.2.js"></script>
7</head>
8<body>
9<p>Form with name=form1</p>
10<form action="" method="post" name="form1">
11        <p><label for="name">Name:</label><input type="text" name="name" id="name" value="This one does not work" /></p>
12        <p><input type="submit" name="submit" value="Submit" id="submit" /></p>
13</form>
14<p>&nbsp;</p>
15<p>Form with name=form2</p>
16<form action="" method="post" name="form2">
17        <p><label for="names">Names:</label><input type="text" name="names" id="names" value="This one works" /></p>
18        <p><input type="submit" name="submit2" value="Submit2" id="submit2" /></p>
19</form>
20<script type="text/javascript">
21$(document).ready(function(){   
22alert('should say "submit" :'+ $('form[name=form1] :submit').attr('name') +
23        '\n'+
24        'should say "submit2":'+ $('form[name=form2] :submit').attr('name'));
25});
26</script>
27</body>
28</html>