# Jquery

### 1. Jquery not working

Sometime we write jquery code like this&#x20;

```javascript
import $ from "jquery";

const YourFunction = () => {
	const init = () => {
		login();
	};

	const login = () => {
		// your code
	};

	init();
};

(function ($) {
	YourFunction();
})(jQuery);

```

An the issue come from jquery that we use conflict witrh jquery default from wordpress. The alternative solution is change your code like this

<pre class="language-javascript"><code class="lang-javascript">(function ($) {
   const YourFunction = () => {
      const init = () => {
         login();
      };

      const login = () => {
         // your code
      };

      init();
<strong>   };
</strong>
   YourFunction();
})(jQuery);
</code></pre>
