I have an html element in which we add a css class dynamically after a while of loading the main page. When i try in JQuery to detect if this element has the added class, the hasClass
method return false.I suggest that is because the element has been dynamically added
.
My code it is inserted inside the $(document).ready(function() {});
.
Javascript:
!$('#travel-1_1_').hasClass('complete');
HTML:
<rect id="travel-1_1_" width="64" height="12.6" y="28.5" x="48" class="complete"></rect>