Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下のスクリーンショットのようなことは可能ですか? 入力は数値型で、「px」は入力自体によって自動的に追加されます (変更できません)。
span右側にテキストがある要素で入力をオーバーレイできますpx。
span
px
プレースホルダーではありません。プレースホルダーは、期待される入力タイプをユーザーに示すためだけに存在します。
あなたは出来る:
document.getElementById で入力の値を取得し、値に「px」を追加できます。最後に、その値を入力に設定できます。