I am trying to change the colspan attribute on some table cells when
the user clicks on a button but it is not affecting the table. Perhaps
someone can tell me what I am doing wrong. Here is my jQuery code:
<<script type="text/javascript">
$(document).ready(function() {
$('#plusSign').click(function(){
$('.ba_toggle').toggle();
if(document.getElementById('plusSign').innerHTML=='+')
{
document.getElementById('plusSign').innerHTML='-';
$('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','red');
});
}
else
{
document.getElementById('plusSign').innerHTML='+';
$('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','green');
});
}
});
});
</script>