I have a bool property in a model:
public bool IsExistSchedule {get; set;}
In the View I wrote the following:
<div id="step1" data-schedule="@Model.IsExistSchedule">
...
</div>
In the generated page data-schedule contain True value.
How to properly work with this value in javascript?
For example, I want to check if variable is true:
var isExist = $('#step1').attr('data-schedule');
if( isExist === "True")
do something
I don't like this part isExist === "True". I should convert it to bool may be or something other. I'm afraid that in other browser the variable may contain other values: true, True, "True", "true".
Thanks.