Jquery Attribute

by Laurie

HTML

<table border="1" cellspacing="0" cellpadding="0">
    <tr><td style="width:100px; color:red;">hello</td></tr>
    <tr><td width="450">hello</td></tr>
    <tr><td style="width:100px; color:red;">hello</td></tr>
    <tr><td style="width:3px; color:green;">hello</td></tr>    
</table>

JavaScript

$('td').each(function(){
  if ($(this).attr('width').indexOf('450') !== -1){
    $(this).removeAttr('width');
  }
});