Why new strings of Javascript destroys old ones

So often when I insert Javascript-functions I notice that they work, which is all good…

But then when I insert another function and a document-selector connected to a button=oncklick, beneath(or above) the old functions, then all of a sudden none of the functions seem to work sometimes. Any idea why that is?

Do I need to create new script tags for every new function or something? Or why is one new function creating problems for the existing ones?

no, there is no need for that

show your code to get help on it