New issue
Advanced search Search tips

Issue 897474 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 24
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

HTMLInputElement .type that (checkbox, radio) 's default value is "on"

Reported by johnny.s...@gmail.com, Oct 21

Issue description

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

Steps to reproduce the problem:
1. document.createElement("input"); and 
   it.setAttribute("radio") or "checkbox"
2. get on created element.value
3. you can get string about "on" 

sample:

const ck = document.createElement("input");
ck.type = "radio";
console.log(ck.value);

What is the expected behavior?
If there value doesn't setting it then get "" or null or undefined

What went wrong?
HTMLInputElement .type that (checkbox, radio) 's default value is "on"

Did this work before? No 

Chrome version: 69.0.3497.100  Channel: stable
OS Version: 10.0
Flash Version: 

m(_ _)m
 
Labels: Needs-Triage-M69
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue!

@Reporter: Could you please share a sample test file with the conditions mentioned in comment#0, which helps us to triage the issue further in a better way.
Components: -UI Blink>Forms>Checkbox Blink>Forms>Radio
Labels: -Needs-Feedback
Status: WontFix (was: Unconfirmed)
The standard defines this behavior, and other browsers have the same behavior.

https://html.spec.whatwg.org/multipage/input.html#dom-input-value-default-on
> default/on
> On getting, if the element has a value content attribute, return that attribute's value; otherwise, return the string "on".

What you want might be ck.checked, not ck.value

I'm sorry for this issue
Thank you so much and good regards.

Sign in to add a comment