javascript - Setting style attribute to none for every table tr and td elements inside a div using jquery -


i have div id testdiv. inside div have table no id or class . set style attribute of table tr , td elements inside div none. how can done using jquery code. example code appreciated

please help. thank you

you can use .removeattr(), this:

$("#testdiv").find("table, tr, td").removeattr("style"); 

note though removes inline styles, whatever's defined in stylesheets still apply.

from more general standpoint, id never needed select element, can use element selector have in .find() call above, example code looks <table>, <tr>, , <td> elements descendants of <div id="testdiv">.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -