2
You can use jQuery to achieve this. Here’s a simple example:
$(document).ready(function() {
$('#Roflag2').change(function() {
if(this.checked) {
$('#callfor').show();
} else {
$('#callfor').hide();
}
});
});
In this code, we’re using the change
event to detect when the radio button’s state changes. If the radio button is checked (this.checked
is true
), we show the div with $('#callfor').show()
. If the radio button is not checked, we hide the div with $('#callfor').hide()
.
Please note that this code assumes that you have included the jQuery library in your project. If you haven’t, you can include it with the following line in your HTML file:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
This line should be placed in the <head>
section of your HTML file. If you’re already using a different version of jQuery, you don’t need to include this line.
Also, please ensure that the radio button and the div have the correct ids (Roflag2
and callfor
respectively) as specified in the jQuery selectors ($('#Roflag2')
and $('#callfor')
). If the ids are different, you should replace Roflag2
and callfor
with the actual ids.
This code should be placed in a <script>
tag either in the <head>
section (if you’re using $(document).ready()
) or at the end of the <body>
section of your HTML file.
Remember to test this code thoroughly to ensure it works as expected in your specific application context. Let me know if you have any questions!
Thanks

1
below is the div
<div class="row" id="callfor">
@if (Model.remarkscrunity == "Y")
{
<span style='font-size:25px; color : green;'>@Html.ActionLink("General Remarks", "remarkscrunity", "Inspection", new { @applnno = Model.applnno }, htmlAttributes: new { @class = "btn btn-orange turbolinks", style = "font-size: 18px", @HttpMethodConstraint = "Post" }) ✔</span>
}
else
{
@Html.ActionLink("General Remarks", "remarkscrunity", "Inspection", new { @applnno = Model.applnno }, htmlAttributes: new { @class = "btn btn-orange turbolinks", style = "font-size: 18px", @HttpMethodConstraint = "Post" })
}
</div>