如何根据单击的单选按钮启用文本区域


how to enable a textarea depending on which radio button was clicked?

这段代码

数据库的屏幕截图

你可以尝试使用JQuery,如果你可以给每个单选按钮和文本区域一个唯一的ID,你可以尝试这样做:

<script>
$(document).ready(function(){
    $("#radio-button-id").click(function(){
        $("#textarea-id").prop("disabled", false);
    });
});
</script>

但是当然要用实际的ID替换"radio-button-id"answers"textarea-id"并在你的head标签中导入JQuery,像这样:

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>