I've been trying to convert a php variable into a java script variable. At the same time I want to save it in a format with HTML tags. The problem is I'm Unable to escape the '<' this character in code.
var lecturers = [
@foreach ($Lecturers as $L)
'{{ '<option>'.$L->Name.'</option>' }}',
@endforeach
];
The Output I received through console log is as follows
["<option></option>", "<option></option>", "<option></option>"]
How can i get the output as
"<option> Name </option>"
I'm using laravel as Framework.