I have a query to be executed on a btn click. The problem is that I can't even open the page because the model is null which I know it is innitialy but becomes not null based on a parameter passed later. What I tried is
JavaScript
$(function(){
$("#btnVer").on("click", function(){
if("@(Model.IntrebareClass != null)")
{
//checkA
if($("#rasA").hasClass("colorA") && checkA == "@Model.IntrebareClass.CorectA")
{
$("#rasA").css("background-color", "green")
}this is a part of the jquery. How do I fix this?


Marius VasileRank #785 · 2.9K reputationPosted Nov 28, 2021, 5:04 AM EST
Srinivasan RamamoorthiRank #877 · 2.5K reputationPosted Nov 27, 2021, 11:16 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 27, 2021, 11:24 PM EST
Satya KarkiRank #78 · 24.6K reputationPosted Nov 28, 2021, 1:15 AM EST
Marius VasileRank #785 · 2.9K reputationPosted Nov 28, 2021, 1:29 AM EST
Marius VasileRank #785 · 2.9K reputationPosted Nov 28, 2021, 1:35 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 28, 2021, 2:13 AM EST