I'm working on a simple razor view with Rider IDE, so I create a simple function as:
@section Scripts {
<script>
function passwordToggle(button, input) {
$(button).click(function() {
if ($(input).attr('type') === "password") {
$(input).attr('type', 'text');
} else {
$(input).attr('type', 'password');
}
})
}
passwordToggle('#toggleCurrentPassword', '#currentPassword');
passwordToggle('#toggleNewPassword', '#newPassword');
passwordToggle('#toggleConfirmPassword', '#confirmPassword');
</script>
}
The code is working but the IDE is detected problems on each use of symbol $
Unresolved function or method $()
And
Invalid number of arguments, expected 0
on .click
function
How can I solve this? Regards