I am using Laravel 5 where I can make a master page (header, footer) and import every page's content in that master page.
I have a dropdown in my header (master page) and in javascript, I have a variable connected to it - var clickable = true;
.
//Master Blade
@yield('content')
<script>
var clickable = true;
$('.dropdown).click(function() {
clickable = false;
})';
</script>
In my view (content), I have a function that I also want to change clickable = true;
//View
('.contentElement').click(function() {
clickable = true;
});
However, it doesn't recognise it. Is there a way that I can achieve what I want to?