Hi
I have below code . When i get cell value printed it shows [object HTMLTableCellelement]
Secondly i want to get dropdown selected text value not id.
<script> var ddl = document.getElementById("ddlBook"); ddl.addEventListener("change", function () { var selectedValue = ddlBook.value; var table = document.getElementById("tbldata"); for (var i = 0; i < table.rows.length; i++) { var row = table.rows[i]; var cell = row.cells[7]; alert(cell); if (cell.innerHTML === selectedValue) { cell.style.backgroundColor = "yellow"; } else { cell.style.backgroundColor = ""; } } }); </script>
Thanks