I am not sure why is my table cell is not animating after click on a button. I want the whole row to animate into a different colour in specific time.
$("#buttonObserve").click(function() {
$("#trl1").animate({
backgroundColor: "#FFD801"
}, 1000);
});
#tableLast {
border-collapse: collapse;
width: 80%;
}
#tableLast td,
#tableLast th {
border: 1px solid #ddd;
padding: 8px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tableLast" align="center">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
<tr id="trl1">
<td id='tdl1'>1</td>
<td id='tdl2'>2</td>
<td id='tdl3'>3</td>
<td id='tdl4'>4</td>
</tr>
</table>
<button class="buttonObserve" id="buttonObserve"><img src="img/observe.png" height='100' width='150'></button>