It seems like the goal you're aiming for is:
Firstly, make sure to reference your elements with an id selector using #
.
Instead of $("bod")
, use $("#bod")
, as '#' indicates an ID.
Also, the way you were trying to retrieve the value for input was incorrect.
Remember to use an ID if you want the value of a specific item. Otherwise, you'll end up with an array by using a generic element selector. Since I assigned an id to your input, you should not just try to get a value off of $('input')
(I added a placeholder image address in your code, feel free to remove it)
Additionally, view the snippet in full screen as the small view may give the impression that your text is disappearing, but it's actually not. The positioning of the img element makes the baseline lower than the snippet viewer window.
$(document).ready(function(){
$("#btn").click(function(){
$("#bod").append('<img alt="" src="'+$('#inp').val()+'">');
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Enter URL :<input id="inp" type="text" value="http://placehold.it/300">
<button id="btn">continue</button>
<div contenteditable="true" id="bod">Click on this text to start writing</div>