prepend(): how to insert "\" before a text?

prepend(): how to insert "\" before a text?

I want to insert "\" before "*" in jQuery because I cannot do it in javascript.

  1. <html>
    <head>
  2. <script src="http://code.jquery.com/jquery-1.5.js"></script>
    </head>
    <body>


  3. <script>
    $(function(){
        $("span:contains('*')").prepend('<span>\</span>');
        });
    </script>





  4. <script>
    var rename = 1;
    for (rename=1;rename<=3;rename++)
        {
        document.write('<span>' + 'a\*file' + '</span>' + rename + '<br />');
        }
    </script>







  5. </body>
    </html>


Is there wrong with my javascript code? It does not recognise the backward slash.
Because it doesn't print out the backward slash, I want to prepend it before asterisks in jQuery.
However, it does not work either in jQuery.

Could anyone who knows it help me? Many thanks.