How to use 'switch case jquery' in JavaScript

Every line of 'switch case 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
this disclaimer
2function toggleSwitch(el) {
3 if ($(el).css("margin-left") === "0px")
4 $(el).css("margin-left", "-47px");
5 else $(el).css("margin-left", "0px");
6
7 $("#filterBlock").toggle();
8}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets