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:
,
Dec 12
,
Dec 12
,
Dec 13
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.!
,
Dec 17
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.
,
Dec 17
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 |
||||
Comment 1 by cuon...@nissho-vn.com
, Dec 12