What i did so far:
Step1: installed "jQuery.UI.Combined" via NuGet
Step2: In my Razorpage I include this code:
<script src="~/lib/jquery/dist/jquery.js" type="text/javascript">
$(document).ready(function () {
$("#test").click(function () {
$("#NavBar_OptionPanel").toggle();
});
});
</script>
Step3: This is my Button:
<a id="test">Settings</a>
Step4: This is the Panel i want to toggle on/off:
<div id="NavBar_OptionPanel">
<label>Options</label>
</div>
What i expected: When clicking on an element with id="test", all elements with id="NavBar_OptionPanel" should toggle on/off
But nothing is happening. So i guess there could be two problems:
- The installation of jQuery is wrong/a step missing
- The usage of jQuery is wrong
Can you help me?
Step1: installed "jQuery.UI.Combined" via NuGetThat's a problem right there. jQuery != jQuery.UI. There's a package called jQuery - install that instead.