How to change a div class dynamically with jQuery

Bootstrap’s grid handles most browser resize issues beautifully, but I ran into a situation where I really needed a div with a col-md-9 class to change dynamically to a div with a col-md-12 class at certain browser sizes only. I gave these divs an id of #jquery-target. This jQuery snippet did the trick.

View the code on JSFiddle here.

Leave a Comment