I'm trying to display a table cell value to the console.log using JavaScript. I get a null value displayed to the console on any attempt. I believe the main issue is how I'm identifying the selector.
I have attempted to display the table cell value using a querySelector. I have attempted using the class and using the id. I'm guessing that I'm not using the correct selector, but I could use some guidance to ensure that the selector I'm using is correct. The class I attempted to use is oj-table-data-cell, and the id is mandatoryParts-table:partNumber_48_2.
var dropDownValue = document.querySelector(".oj-table-data-cell select");
console.log(dropDownValue.value);
The result I get in the console is null.
Both attempts using either the class or the id have resulted in null being displayed in the console. I did not use both class and id at the same time, just trying different ways to obtain the table cell value.
Here are some screenshots of the table display and the source code.