JSFiddle - React, Tailwind, and code Playground

by Kupendra Pansuriya

HTML

<input class="radio-checkbox" type="radio" name="choice" value="custom_msg" checked>Custom Message :<br/>
<input style="width:200px" placeholder="your msg" type="text" id="custom_text"/>

<br/>

<input class="radio-checkbox" type="radio" name="choice" value="custom_img">Image :<br/>
<input style="width:200px" placeholder="an image url" type="text" id="custom_img"/>

JavaScript

$(document).ready(function(){

$(".radio-checkbox").change(function() {
            if (this.value == 'custom_msg') {
                $("#custom_img").prop('disabled', true);
                $("#custom_text").prop('disabled', false);
            }
            else if (this.value == 'custom_img') {
                $("#custom_text").prop('disabled', true);
                $("#custom_img").prop('disabled', false);
            }
});
    
    });