check the folder structure. when inserting js files, the editor has nothing to do with the editor.
one more thing that your code looks like jQuery code, and for it to run, you will need a jQuery library file included in front of your script.js file. To use jQuery functions in your code, you first need to add a function library.
check the code below
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="script.js"></script>
source share