JSFiddle - React, Tailwind, and code Playground
HTML
<select id="selectionType">
<option value="-1">Select One</option>
<option value="0">Name</option>
<option value="1">ID</option>
</select>
<input type="text" id="inputBox">
JavaScript
var placeholderText = {0:"Enter your name",1:"Enter your ID"};
$("#selectionType").on("change",function() {
var selection = document.getElementById("selectionType");
var inputBox = document.getElementById("inputBox");
var selectedVal = selection.options[selection.selectedIndex].value;
if (placeholderText[selectedVal] !== undefined) {
inputBox.placeholder = placeholderText[selectedVal];
}
});