How to use 'add attribute jquery' in JavaScript

Every line of 'add attribute jquery' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
22function addAttribute(attribute, value) {
23 var attributes = filterUrl.getQueryVar(attribute);
24 if (!attributes) {
25 attributes = value;
26 } else {
27 if (attributes.indexOf(value) == -1) {
28 attributes += ',' + value;
29 }
30 }
31 filterUrl = filterUrl.addQueryVar(attribute, attributes);
32 return filterUrl;
33}
149addAttribute(name: string, value: string = '') {
150 this.attrs.push(name, value && value.toLowerCase() || '');
151}

Related snippets