How to add a value to colspan dynamically?

1

I have the following:

<td class="total" colspan=""> Areas </td>

Since from jquery can I enter a value that I have in a global varibale?

    
asked by JDavid 24.04.2017 в 16:59
source

1 answer

4

Although I do not know if it's the only td you want to add that to, or it's all in the table, if it's just that add an id to your td to make it easier to obtain.

$(".total").attr("colspan", tuVariableGlobal);
    
answered by 24.04.2017 / 17:04
source