jQuery does not work on WordPress editor

Your jQuery code is using the $ symbol without accounting for noConflict mode.

More information:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers