use the placeholder attribute instead of a placeholder text

This commit is contained in:
Manuel Friedli 2015-03-26 17:26:17 +01:00
parent 68b59b0370
commit e2c7f543a9
2 changed files with 7 additions and 6 deletions

View file

@ -58,7 +58,7 @@
]; ];
var optiontemplate = "<option name='{identifier}'>{name}</option>"; var optiontemplate = "<option name='{identifier}'>{name}</option>";
var template = "<div id='wrapper-{index}' class='wrapper'><textarea id='input-{index}' class='input' onchange='den.update(this);'>{content}</textarea>" var template = "<div id='wrapper-{index}' class='wrapper'><textarea id='input-{index}' class='input' onchange='den.update(this);' placeholder='Please enter your input ...'>{content}</textarea>"
+ "<select id='type-{index}' class='conversion' onchange='den.convert(this);'>" + "<select id='type-{index}' class='conversion' onchange='den.convert(this);'>"
+ "{options}" + "{options}"
+ "</select></div>"; + "</select></div>";
@ -72,7 +72,7 @@
template = template.replace(/\{options\}/g, options); template = template.replace(/\{options\}/g, options);
$(document).ready(function() { $(document).ready(function() {
var $new = $(template.replace(/\{index\}/g, "0").replace(/\{content\}/g, "Please enter your input here.")); var $new = $(template.replace(/\{index\}/g, "0").replace(/\{content\}/g, ""));
$("body").append($new); $("body").append($new);
}); });

View file

@ -1,10 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>encoder-decoder</title> <meta charset="UTF-8" />
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script> <title>encoder-decoder</title>
<script type="text/javascript" src="dencoder.js"></script> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="dencoder.css" /> <script type="text/javascript" src="dencoder.js"></script>
<link rel="stylesheet" type="text/css" href="dencoder.css" />
</head> </head>
<body> <body>
</body> </body>