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