Change flex-direction with JavaScript

Edit This Code :
Result :