blob: 32d31bb1f41e94b10e4fc307a3445f27205757c3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Number type input shows and accepts localized numbers</title>
<style>
:invalid {
border-color: red;
-webkit-box-shadow: 4px 4px 8px #ff8888;
}
</style>
</head>
<body>
<div id="console"></div>
<p>Output test: The following text field should have a localized representation for "-1234.5678".
e.g. "-1234.5678" for en_US locale, "-1234,5678" for fr_FR locale. The thousand separator is
currently off.</p>
<div><input type=number value="-1234.5678" step=any></div>
<p>Input test: Type a localized representation of a number (e.g. -1,234.5678 for en_US locale,
-1.234,5678 for fr_FR locale) into the following text field.
You'll see an equivalent number in the standard format on the bottom of the text field.</p>
<div><input type=number id=target step=any oninput="handleInput()"></div>
<div>Standard format: <output id=output></output></div>
<script>
function handleInput() {
document.getElementById('output').value = document.getElementById('target').value;
}
</script>
</body>
</html>