I can not understand Javascript language properly, I am trying to write inside placeholder but it is not working, here is my code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>val demo</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#myInputText').keyup(function() {
$('#myOutputText2').val('placeholder="' + $(this).val() + '"');
$('#myDIVTag').html('<b>' + $(this).val() + '</b>');
});
});
</script>
</head>
<body>
<input id="myInputText" type="text" name="post_title" size="79" placeholder="Enter title here" />
<p>Snippet Preview: <a href="#" id="myDIVTag"></a></p>
<input name="textfield2" type="text" id="myOutputText2" size="79" />
</body>
</html>
It is work perfectly but I want this in to placeholder mode. Please help me.