I'm trying to dynamically place a button element next to some text but I'm getting the following in the DOM: Text next to button [object Object].
$btn = $('<button>').text('Button');
$('<div>').html('Text next to button ' + $btn).appendTo($('#test'))
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<div id="test"></div>
jsfiddle: https://jsfiddle.net/p43rft4q/1/
What am I doing wrong here and how can I fix this?