$("textarea").each(function(count){ var textarea_id = $(this).attr("id"); var oFCKeditor = new FCKeditor(textarea_id); oFCKeditor.BasePath = "/javascript/fckeditor/" ; oFCKeditor.ReplaceTextarea() ; });