I have a scenario where the contents of the div
are to be displayed as per the value returned from the java-script function
pseudo HTML:
<div>
if(true==myfunction())
{
<p>True is returned from the javascript function</p>
}
else
{
<p>False is returned from the javascript function</p>
}
</div>
pseudo javascript function
myFunction()
{
var x = false;
// Some code to decide value of x.
return x;
}
I am using Asp.net core, my Javacript code is present in site.js and html code is present in cshtml.
It would be very helpful is someone can suggest an approach on how to achieve this. Note: The code presented is not the actual code, but represents the actual scenario.