JSFiddle - React, Tailwind, and code Playground
by algoritma
HTML
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<select id="act">
<option>Choose...</option>
<option value="sms_send">SMS Send</option>
<option value="email_send">E-Mail Send</option>
</select>
<input type="hidden" id="sms" placeholder="Sms?">
<input type="hidden" id="email" placeholder="E-Mail?">
<script type="text/javascript">
const d = document;
const act = d.getElementById('act');
act.onchange = function(){
const secilen = act.options[act.selectedIndex].value;
switch(secilen) {
case 'sms_send':
d.getElementById('sms').type = 'text';
d.getElementById('email').type = 'hidden';
break;
case 'email_send':
d.getElementById('sms').type = 'hidden';
d.getElementById('email').type = 'text';
break;
default:
d.getElementById('sms').type = 'hidden';
d.getElementById('email').type = 'hidden';
break;
}
};
</script>
</body>
</html>