[Solved] JQuery add placeholder value to a specific div [closed]


I have created an example of how to add an <input> placeholder into a <div> when the page loads:

HTML

<div class="write"></div>
<input placeholder="Hello World" type="text" class="read" />

JQuery

$('.write').text($('.read').attr('placeholder'));

JsFiddle

–EDIT–

Here is the correct JQuery for your provided code:

$('#placeholder-value').text($('#input-id').attr('placeholder'));

solved JQuery add placeholder value to a specific div [closed]