how to sho the active navigation ling using javascript
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script>
$(document).ready(function() {
var CurrentUrl= document.URL;
var CurrentUrlEnd = CurrentUrl.split('/').filter(Boolean).pop();
console.log(CurrentUrlEnd);
$( "#lu-ID li a" ).each(function() {
var ThisUrl = $(this).attr('href');
var ThisUrlEnd = ThisUrl.split('/').filter(Boolean).pop();
if(ThisUrlEnd == CurrentUrlEnd){
$(this).closest('li').addClass('active')
}
});
});
Also in JavaScript:
- fetch post json
- how to declare 3d array in javascript
- check array empty or not in javascript
- javascript count element in array
- return value from javascript function
- brain.js cdn
- js get all values of object
- ajax .put
- show ad on facebook game
- convert json string to json object in java
- use of eventemitter in angular
- check if a key exists in an object javascript
- jsdoc optional param
- disable input field from jquery
- remove last character from string jquery
- how to install reveal.js from node
- __dirname go back one directory
- merge objects javascript
- how to make text come up with javascript
- récupérer la position d'un élément javascript
- javascript advanced concepts
- vue test utils emitted
- factorial in javascript using for loop
- javascript get index of object in array