Hide/Show Values Inside TD tags
How can I hide or show the value containe开发者_如何学God inside a TD tag?
E.g:
<td id="dateCell<%= i %>">
<%= Html.Encode(row.ActionOn.HasValue ? Html.FormatDateTime(row.ActionOn.Value) : Html.Encode("")) %>
</td>
How can I get the encoded value and hide or show it depending on a condition?
$('#myDropDown').change(function() {
if($(this).val() == 4) {
$('#dateCell').hide();
} else if($(this).val() == 3) {
$('#dateCell').show();
}
});
although this will hide the entire td, which isn't necessarily a good practice
精彩评论