Insert <span> in <p> element

Question!

I got like;

<p>Variable Text</p>

And I want to it to be;

<p>Variable <span>Text</span></p>

Is this possible by a javascript function? / or jQuery.

Oh yeah, and the p-element got an ID and the text inside the p-element is variable but always consists of 2 words. I want a span around the last word of the text by a javascript function.



Answers
$("document").ready(function(){
  $("p").append("
By : Robby Zhi


With JQuery append

$("#paragraphId").append('


jQuery is easier, and personally I think it's better to use than only javascript:

jQuery:

$("#paragraphID").append("


This video can help you solving your question :)
By: admin