JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tbody>
<tr>
<td class="row_leaveform">Travel Tickets:</td>
<td class="row_leavedata">
<input type="radio" class="ticket" name="ticket" value="Yes">Yes
<input type="radio" class="ticket" name="ticket" value="No">No</td>
</tr>
<tr id="destination_data">
<td class="row_leaveform">Destination</td>
<td class="row_leavedata"><b>Doha</b> to
<input type="text" name="destination" id="destination" value="" size="31">
</td>
</tr>
</tbody>
</table>
CSS
#destination_data {
display: none;
}
JavaScript
$(document).ready(function () {
$(".ticket").on('click', function () {
//check if its checked. If checked move inside and check for others value
if (this.checked && this.value === "Yes") {
//add a text box next to it
$("#destination_data").show();
} else if (this.checked && this.value === "No") {
//remove if unchecked
$("#destination_data").hide();
}
});
});