Inserting an HTML prefix with Javascript

Hi guys, I’m a novice am hoping someone can help me. I have an element generated by a plugin which I want to alter by inserting an HTML prefix. An example of the element would be this:

<span class="cost">£25 – £32</span>

I want the output to become:

Cost: £25 - £32

I tried this:

jQuery(document).ready(function(){
  jQuery('span.cost').before('Cost:&nbsp;');
});

… but it didn’t work and I don’t really know what I’m doing!

Can anyone help?
Many thanks
Mike.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.