$(document).ready(function() { $("button").on("click", function() { $(".menu ul").slideToggle(); }); /*Подгрузка на другую страницу*/ $(".test").load("index.html .menu") }); .menu ul { display: none; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="menu"> <button>Menu</button> <ul> <li><a href="page.html">Page</a> </li> <li><a href="page.html">Page</a> </li> <li><a href="page.html">Page</a> </li> <li><a href="page.html">Page</a> </li> </ul> </div> We have two pages: index.html and page.html . When we are on the index.html page, we press the button and the menu works with a bang! When we are on page.html we load $(".test").load("index.html .menu") into the text block of the menu, slideToggle() does not work! What is the problem?
$(".test")- where is this element? He is not.load("index.html .menu")is a file or selector in your quotes? It can not be both at the same time - Crantiszindex.htmlfile? And why did you decide that this is possible? And most importantly, where did you find that it should work like this:load("index.html .menu")? - Crantisz