JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<head>
<style>
.riggedinput::-webkit-input-placeholder {
margin: 0em;
font: -webkit-small-control;
color: initial;
letter-spacing: normal;
word-spacing: normal;
line-height: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
}
</style>
</head>
<body>
<input>
<input id="test" type="number" class="riggedinput" placeholder="100.10USD" onfocus="focused()" onblur="blurred()">
<input>
</body>
JavaScript
function focused() {
var test = document.getElementById('test');
setTimeout(function() { // timeout needed so that keyboard changes to numeric when using Next/Previous keyboard navigation buttons
if (document.activeElement === test) {
test.type = 'text';
test.value = test.placeholder;
test.placeholder = '';
}
}, 1);
}
function blurred() {
var test = document.getElementById('test');
var value = test.value;
test.placeholder = value;
test.value = '';
test.type = 'number';
}
if (!/^(iPhone|iPad|iPod)$/.test(navigator.platform)) alert ('Code specific to Mobile Safari');