What is the right way to wrire javascricp in wordpress : I found javascript I like to use in my wordpress website but it's doesn't work... Here is the link to the script: http://jsfiddle.net/j08691/fs6Mb

Here is how I tried to write it:

<!-- begin snippet: js hide: false -->

<!-- language: lang-html -->

    <head>
    <style>
    p span {color:blue;}
    </style>
    </head>

    <body>

    <p>sony sensor 2.1mp</p>

    <script>
    $('p').html(function(index, value) {
        return value.replace(/(\d+)/g, '<span>$1</span>');
    });
    </script>

    </body>

<!-- end snippet -->

What do I need to change in the script to make it work?

My actual goal is to make the numbers bigger without writing <span> in the text so any other ideas will be welcome...