I am doing dynamic filtering ,but i am unable to do if condition check.

i want to insert targetOS var inside <%if(data[i].ListNames == ***targetOS*** ){%>

for the above syntax it is giving "targetOS variable is undefined"

Please help on this.

```js
 $(document).on("change",'.COTSCurrentOSClass', function(e){  
  var selectedOS   = $(this).val();    
  var targetOS =  "OS::From::"+selectedOS;

  <%for(var i=0;i<data.length;i++){%>
   <%if(data[i].ListNames == ***targetOS*** ){%>
    <%for(var j=0;j<data[i].Values.length;j++){%> 
    console.log("options are");
    console.log(data[i].Values[j]);
  <%}}}%>

  ($(this).parent().parent()).find(".COTSTargetOSClass").append("<option>Select One</option>");

 });
```