Well without seeing your code it's impossible for anyone here to help.
I do know the problem is not to do with DW, though. If it doesn't work, either the code is flawed or the implementation is wrong - JS doesn't react differently according to which program you used to insert it. It could be Notepad, DW, or any other IDE or editor.
This probably won't help you, but consider getting out of WYSIWYG editors. They have had their day and are pretty much useless nowadays - there's no way they can show you how your site will look and behave. If you get yourself a good IDE and work in code only, you'll learn much more.