Adding Javascript Code Into Invoice.tpl

When JavaScript Codes are added the invoice.tpl file which is in
design->beckend->mail->templates->orders folder javascript codes do not working.
When we look at source codes on receipt view, we saw that javascript codes has been deleted.
How we can integrate javascript codes into invoice.tpl file?I think that javascript codes somehow are filtering and removing.
We looking for your support

Did you try to add data-no-defer parameter?