Toggling a panel and the clicker text I have written some jQuery that slides open a panel on click, and changes the toggles of the clickable bit from 'Show All' to 'Hide All'.

It works, but I'm trying to figure out what would be the most efficient way to do it, as it seems kind of long to me, and some HTML is repeated.

This is the working version and a working fiddle here:

$(function() {
    //Hide panel with jQuery and create toggle button so subjects will just show if there's no javascript
$("#panelSub").hide();
$('#toggleSubjects').html('&lt;h5 class="subjectOpen"&gt;&lt;i class="fa fa-arrow-circle-down"&gt;&lt;/i&gt;Show All Subjects &lt;i class="fa fa-arrow-circle-down"&gt;&lt;/i&gt;&lt;/h5&gt;');
    //Toggle extra subject panel
    $("#toggleSubjects").click(function(){
        $("#panelSub").slideToggle("slow");
        //Change toggle text for show / hide
            if ($.trim($('.subjectOpen').text()) === 'Show All Subjects') {
            $(this).html('&lt;h5 class="subjectOpen"&gt;&lt;i class="fa fa-arrow-circle-up"&gt;&lt;/i&gt;Hide All Subjects &lt;i class="fa fa-arrow-circle-up"&gt;&lt;/i&gt;&lt;/h5&gt;');
            } else {
            $(this).html('&lt;h5 class="subjectOpen"&gt;&lt;i class="fa fa-arrow-circle-down"&gt;&lt;/i&gt;Show All Subjects &lt;i class="fa fa-arrow-circle-down"&gt;&lt;/i&gt;&lt;/h5&gt;');      
                }
            });
            return false;
});
Please check out this updated jsFiddle: https://jsfiddle.net/b4mp044z/5/

I've changed your JS code into :

$(document).ready(function () {    
    $("#panelSub").hide();

    $("#toggleSubjects").click(function () {
        $("#panelSub").slideToggle("slow");                
        $(this).find('i').toggleClass('fa-arrow-circle-down fa-arrow-circle-up')
    });
    return false;
});


and updated your HTML and CSS to hold all your structure and content. It's a good practice to keep things separated (HTML, CSS and JS)