using jQuery with Rails 3.2

Hi I am learning to use jQuery but I can't seem to get the following
line to work from my html.erb file

<script type="text/javascript">
document.write("<p>Hello from javascript!</p>")
$("<p>Hello from jQuery!</p>")
</script>
</p>

I see the output for the basic javascript call, but nothing from
jQuery, what am I doing wrong?

I know Rails 3.2 comes with jQuery installed and I do see it in the Gemfile:

gem 'jquery-rails'

I figured out I need to use:

$("<p>Hello from jQuery!</p>").appendTo('body')