You may want to add some of your own JavaScript / jQuery for specific functions on your Joomla site. Keep in mind that the standard Joomla installation will already have the jQuery core library files included. It is also employing the jquery-noconflict.js so that their is no conflict between the JavaScript and other scripting languages.

If you look at the source code for a standard Joomla installation you will see the following lines:

<script src="" class="attribute-value">/testinstall/media/jui/js/jquery.min.js" type="text/javascript"></script>
<script src="" class="attribute-value">/testinstall/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
<script src="" class="attribute-value">/testinstall/media/jui/js/jquery-migrate.min.js" type="text/javascript"></script>
<script src="" class="attribute-value">/testinstall/media/system/js/caption.js" type="text/javascript"></script>
<script src="" class="attribute-value">/testinstall/media/jui/js/bootstrap.min.js" type="text/javascript"></script>

On top of these files, your template and your installed extensions may also be loading some of their own .js files.

Linking to an External JavaScript file

In the index.php file for your template, found in templates/yourtemplate/index.php, you can use the Joomla API for linking to a JavaScript file.

ALWAYS make a safety backup of the index.php file before editing the original. These changes may be overwritten if you upgrade, so keep a log of what changes you have made to index.php and always backup the entire site and database before running an upgrade on the Joomla installation or the template.

Add this in the top <?php ... ?> section of index.php for your template.

$doc = JFactory::getDocument(); // chances are this line is already in the file - don't add it twice
$doc->addScript('templates/' . $this->template . '/js/customjavascript.js');

You can use a name for your file other than customjavascript, certainly.

Proper format for jQuery files

Since the noconflict JavaScript file is being employed, you need to format the code for your JavaScript in the correct manner.

            ... //jQuery code here       

Read more about this subject at Joomla Docs: Adding JavaScript