Using jQuery to replace one tag with another

Goal: Using jQuery, I'm trying to replace all the occurrences of: <code> ... </code> with: <pre> ... </pre> My solution: I got as far as the following, $('code').