Skip to content

Commit

Permalink
Clear out textarea on initial focus
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgreiner committed Jun 12, 2011
1 parent 4495857 commit 1743576
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mincss/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<body>

<form id="minCSS" action="">
<textarea id="input" rows="20" cols="100">Enter your CSS code here.</textarea>
<textarea id="userInput" rows="20" cols="100"></textarea>
</form>

<div>
Expand Down
9 changes: 9 additions & 0 deletions mincss/mincss.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
$(document).ready(function () {

var defaultString = 'Enter your CSS code here.';
$('#userInput').val(defaultString);

$('#userInput').click(function () {
if ($(this).val() == defaultString) {
$(this).val('');
}
});

});

0 comments on commit 1743576

Please sign in to comment.