toggle one class add and one class remove same time and after click remove class add and add class remove jquery
$(".nav-link").click(function () {
// If the clicked element has the active class, remove the active class from EVERY .nav-link>.state element
if ($(this).hasClass("active")) {
$(".nav-link").removeClass("active");
}
// Else, the element doesn't have the active class, so we remove it from every element before applying it to the element that was clicked
else {
$(".nav-link").removeClass("active");
$(this).addClass("active");
}
}); function viewPastClass(id) {
var class_date = $('#pastclassdata' + id).val();
// alert(class_date);
// $('#plclasses').hide();
$.ajax({
type: 'GET',
url: '{{ url("/teacher/class/viewPastClass") }}',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
'class_date': class_date,
},
success: function(result) {
$('#plclasses').show(class_date);
},
error: function() {}
});
}
Also in JavaScript:
- compare two arrays
- global site tag (gtag.js) - google analytics gatsby
- live search using fetch api
- how to access a database in express
- html javascript find data attribute
- javascript online test
- json vs gson
- hide automatically show and hide javascript
- "socket.removeListener"
- js numbers
- dwhdjksbhds efedhgsd djsioqdhsjd
- install node js using nvm ubuntu
- how to sort string aray in ts
- javascript set variable inline
- cannot get / angular
- javascript async await for x seconds
- javascript pluck from array of objects
- how to hide a input and label jquery
- error: Error: Unable to resolve module `crypto` from `node_modules\crypto-js\core.js`: crypto could not be found within the project.
- javascript print numbers in the given range
- how to add oAuth google signin in react native app
- jsx if block
- copy to clipboard javascript
- react native elements