pythonic pythonic - 1 year ago 38
CSS Question

Is it possible to change the class name of a div element

I have something like shown below.

<div class="alert alert-info" style="width:224px">
<strong>Info!</strong> This is a netural alert

Through javascript or jquery, at certain condition, I want to change the class of that div element from
alert alert-info
alert alert-success
. Is that possible? And if so, how?

Answer Source

Change class with condition, Use the following sample

if(0==0)//your condition goes here