How To Add Or Remove Class From DIV

I have a DIV like the one below:

<div class=”col-xs-6 form-field input_controls”></div>I want to change col-xs-6 to col-xs-12. I attempted this with the below code:

But I am getting an error stating :Uncaught TypeError: Cannot read property ‘removeClass’ of null.

Its more like your DOM structure is not ready when the javascript executes. So, you need to add a ready event:

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments