Skip to main content
added 14 characters in body
Source Link
Tushar
  • 87.4k
  • 21
  • 164
  • 182

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

Demo

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

Demo

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

Demo

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

added 12 characters in body
Source Link
Tushar
  • 87.4k
  • 21
  • 164
  • 182

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

Demo

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

Demo

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

added 23 characters in body
Source Link
Tushar
  • 87.4k
  • 21
  • 164
  • 182

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

You can use appendTo()

Insert every element in the set of matched elements to the end of the target.

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

You can use appendTo() to move element in DOM

Insert every element in the set of matched elements to the end of the target.

$('.tomove').appendTo('#menu-item');
ul { list-style-type: none; margin: 0; padding: 0; } li { color: green; } #menu-item:hover { color: red; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <ul> <li id="menu-item">//move into here</li> </ul> <div class="tomove">Move me There</div>

Source Link
Tushar
  • 87.4k
  • 21
  • 164
  • 182
Loading