I\'m making a formbuilder, I would like to change the appearance of for example a heading div. When clicked it should get a border but when another dynamically generated div
You can use a single line to add and remove class on a div. Please remove a class first to add a new class.
$('div').on('click',function(){ $('div').removeClass('active').addClass('active'); });