javascript - jQuery change class of a div -


i have simple question, new , not getting it. binding data label id=lbl_arrflt. when num changed want change class of it's parent div. how do that?

 <li>     <div class="top">         <label>arr flt</label>     </div>     <div class="bottom">         <label id="lbl_arrflt">{{arrival.flt}}</label>     </div> </li> 

right trying this

$("#lbl_arrflt").parent().attr("class", "top noton"); 

what's wrong?

more info -- there function checks new data. if new data

function highlightfor(){      $("#lbl_arrflt").parent().attr("class", "top noton"); }  

you can use addclass , removeclass on elements this. in case have add , remove class several times, toggleclass might useful you.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -