Repository navigation
Expand file tree
/
Copy pathjquery-data-method.html
More file actions
55 lines (38 loc) · 1.66 KB
/
Copy pathjquery-data-method.html
File metadata and controls
55 lines (38 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery's Data Method – How and Why to Use It | Tutorialzine Demo</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" />
</head>
<body>
<form method="post" action="" id="originalForm">
<fieldset>
<legend>Form Fields</legend>
<label for="name">Name:</label>
<input type="text" name="name" id="name" />
<label for="country">Country:</label>
<input type="text" name="country" id="country" />
<label for="age">Age:</label>
<input type="text" name="age" id="age" />
<span id="output"></span>
</fieldset>
<fieldset>
<legend>Controls</legend>
<input type="button" value="Output the myFormObj object" />
<input type="button" value="Set myFormObj.name="Homer"" />
<input type="button" value="Display my HTML5 data attribute" data-someobj='{"someNumber":23.3,"someString":"asdf"}' />
</fieldset>
</form>
<p class="note">The myFormObj variable is linked to the form. Changes to the form fields affect the properties of the object and vice-versa.</p>
<!-- Feel free to remove this footer -->
<div id="footer">
<div class="tri"></div>
<h1>jQuery's Data Method – How and Why to Use It</h1>
<a class="tzine" href="http://tutorialzine.com/2010/11/jquery-data-method/">Read & Download on</a>
</div>
<script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.4.min.js"></script>
<script src="js/jquery.datalink.js"></script>
<script src="js/script.js"></script>
</body>
</html>