title: How add JavaScript code to a js file in wordpress
body: <p>How add javascript code to a .js file  and add to function.php in wordpress?
  I have that js code and I add that code to a .js file and use that in function.php by wp_enqueue_script() function but It doesn't load.</p>
  
  <pre><code> $(document).ready(function () {
          //  When user clicks on tab, this code will be executed
          $(".mtabs li").click(function () {
              //  First remove class "active" from currently active tab
              $(".mtabs li").removeClass('active');
  
              //  Now add class "active" to the selected/clicked tab
              $(this).addClass("active");
  
              //  Hide all tab content
              $(".mtab_content").hide();
  
              //  Here we get the href value of the selected tab
              var selected_tab = $(this).find("a").attr("href");
  
              //  Show the selected tab content
              $(selected_tab).fadeIn();
  
              //  At the end, we add return false so that the click on the link is not executed
              return false;
          });
          $("#simulate").click(function () {
              $('a[rel="tab2"]').trigger("click");
          });
      });
  </code></pre>