Menu

Check and replace the attribute value using JS

 We can use JQuery to find the element and then we can replace the attribute value of an HTML element. Below is a JS code snippet to find and replace an attribute value.


$this.next().attr('aria-expanded', function(index, attr){

    return attr == 'false' ? 'true' : 'false';

});

1 comment:

  1. He is an experienced astrologer and has deeply studied astrology in his early years. Astrologer Gautam is also a famous love psychic reader in NJ, vashikaran specialist in new Jersey and provide top solution for love problems, marriage issues, relationship problems based on astrology. Best Indian Astrologer in New York

    ReplyDelete