New issue
Advanced search Search tips

Issue 914257 link

Starred by 2 users

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

javascript get innertext of option select is empty

Reported by cuon...@nissho-vn.com, Dec 12

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

Steps to reproduce the problem:
1. html
<select id="box1">
<option value="98">dog</option>
<option value="7122">cat</option>
<option value="142">bird</option>
</select>
2. js
console.log($("#box1 option")[0].innerText);
3. result
console show ""

What is the expected behavior?
console show value "dog"

What went wrong?
console show value ""

Did this work before? N/A 

Chrome version: 70.0.3538.110  Channel: n/a
OS Version: 10.0
Flash Version:
 
IE and Firefox work fine
Labels: Needs-Triage-M70
Components: -Blink Blink>DOM
Cc: phanindra.mandapaka@chromium.org
Labels: Needs-Feedback Triaged-ET
Thanks for filing the issue...

Tried to reproduce the issue on reported chrome version 70.0.3538.110 using Windows 10. 
Steps:
---------
1. Launched reported chrome
2. Created .html file and .js and kept in one folder 
3. Opened file and opened Dev tools > console 
As we have seen empty page on console.

@Reporter: It would be really helpful if a sample file is provided, so that we can investigate the issue further and Could you please upgrade to latest chrome stable 71.0.3578.98, you can download latest chrome builds here:" https://www.chromium.org/getting-involved/dev-channel ". Let us know whether issue still persists.

Thanks.!
I found the same issue, but it only happened to me when the <option> is inside a <select multiple>. I can get the innerText if it's inside a simple <select>. I created a test case that I'm attaching.

I tested the file using SauceLabs and I found that the issue does not appear in Chrome 70 but it does in Chrome 71. Latest versions of Firefox, Safari, IE and Edge work as expected. I'm attaching the screenshots of the tests for both versions of Chrome.

All the testing was done in Windows.
TestOptionInnerText.html
898 bytes View Download
SauceLabsWin10Chrome70.png
96.5 KB View Download
SauceLabsWin10Chrome71.png
90.9 KB View Download
Seems ok in 72 so the underlying bug could be related to the series of reverts in  https://crbug.com/897373#c67 

Sign in to add a comment