Hooking a JS script at node submission to alter data submitted I am building a website in which a lot of the text comes from Word docs.
The problem is that when you copy from a Word doc to WYSIWYG editor, the resulting HTML and CSS is horrible.

I want to implement a JS script that will run whenever a node (Drupal's basic page) is created or updated, to clean and optimize the data.

I've seen that I must create a custom module and use a hook.
Looking through the list of Drupal 7's hooks, I've noticed hook_node_submit() which seems perfect but in it's documentation (here) is written:


  This hook is intended for adjusting non-field-related properties.


So:


Do I have any other method simpler than module?
What is the correct hook I should use?
You can look into either https://www.drupal.org/project/sanitizable or 
https://www.drupal.org/project/pasteformat both does the job.

and if you are looking hook based solution, i would suggest you hook_node_presave worth looking their documentation.