How to use 'javascript addattribute' in JavaScript

Every line of 'javascript addattribute' 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}

Related snippets