Javascript form/textbox/alert
<p>It's my first day working with JavaScript, and I need help on a simple demo. I need to take the value from <code>class="populateValue"</code>, and make it fill in the text box and alert when the button is clicked.</p>

<p>Right now it is returning <code>'[object Object]'</code> in both text box and alert.</p>

<p>My code is:</p>

<pre><code>&lt;section&gt;
    &lt;form&gt;
        &lt;input type="text" id="demoText" /&gt;
        &lt;button class="populateValue" value="1234"&gt;Populate Value&lt;/button&gt;
    &lt;/form&gt;
&lt;/section&gt;

&lt;script&gt;
    $(document).ready(function () {
        $('.populateValue').on('click', function (event) {
            event.preventDefault();
            $('#demoText').val($('.populateValue'))
            alert($('#demoText').val());
        });
    });
&lt;/script&gt;
</code></pre>

<p>Any advice?</p>
