Search code examples
javascriptjqueryappendappendchild

How to append Content using Javascript only


I've got this below in jQuery, Where on a window width less than 1024px, I want to append ".moveThisContent" and move it to ".newLocation" what the best way to do this in Javascript is? Would it be to use .appendChild

if($(window).width() < 1024){
  $(".newLocation").append($(".moveThisContent"));
}

Solution

  • With this i've used .appendChild and that does what i need.