Skip to content

Commit

Permalink
Add an example on usage with textareas
Browse files Browse the repository at this point in the history
  • Loading branch information
x3ro committed Sep 15, 2011
1 parent 0d8a416 commit c6e46c9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions example.html
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
<!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" xml:lang="en" lang="en">
Expand All @@ -9,16 +9,18 @@
<script type="text/javascript" src="jquery.defaultText.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('input#field1').defaultText('This is field 1');
jQuery('input#field2').defaultText({text: 'This is field 2', clearOnSubmit: false});
jQuery('#field1').defaultText('This is field 1');
jQuery('#field2').defaultText({text: 'This is field 2', clearOnSubmit: false});
jQuery('#field3').defaultText({text: 'This is field 3'});
});
</script>

</head>
<body>
<form onsubmit="return false;">
<input id="field1" type="text" />
<input id="field2" type="text" />
<input id="field1" type="text" /> <br/>
<input id="field2" type="text" /> <br/>
<textarea id="field3"></textarea> <br/>
<input type="submit" />
</form>
</body>
Expand Down

0 comments on commit c6e46c9

Please sign in to comment.