My collapsible jquery div code functions properly on codepen and JSFiddle. However, when I transfer everything to my own webpage (with modified content), the div does not expand as expected. What could be causing this issue, or where did I make a mistake?
The script tags in the head section are:
<head>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<script type="text/javascript">
$(".header").click(function () {
$header = $(this);
$content = $header.next();
$content.slideToggle(500, function () {
$header.text(function () {
return $content.is(":visible") ? "Collapse" : "Expand";
});
});
});
</script>
</head>
The content within the body is as follows:
<form method="post" action="sales_report.php" enctype="multipart/form-data">
//multiple <input /> fields here
<div class="container">
<div class="header"><span>+Options</span></div>
<div class="content">
<h3>Designate the Column of:</h3>
<p>Account Name</p>
<input required type="number" name="sales_report_col_acc" id="sales_report_col_acc" value='1' />
<p>Sale Amount</p>
<input required type="number" name="sales_report_col_amt" id="sales_report_col_amt" value='2' />
<p>Sale Date (optional)</p>
<input type="number" name="sales_report_col_date" id="sales_report_col_date" value='3' />
</br />
</div>
</div>
<input type="submit" name="sales_report_submit" value="Go" />
</form>
Any guidance on resolving this issue would be greatly appreciated. Could there be any essential components related to jquery that I might have overlooked?