js error in modal (popup)

1

My question is about a modal code that I modified but the error js and modal does not open

This is the html part:

<div class="page-wrapper">
  <a class="btn trigger" href="javascript:;">Click Me!</a>
 </div>
<div class="modal-wrapper">
  <div class="modal">
    <div class="head">
      <a class="btn-close trigger" href="javascript:;"></a>
    </div>
     <div class="content">
    </div>
  </div>
</div>

and this is the part of js that I put before tag closing:

    <script type="text/javascript">
        $(document).ready(function() { //erro nessa linha "Uncaught ReferenceError: $ is not defined"
          $('.trigger').click(function() {
             $('.modal-wrapper').toggleClass('open');
            $('.page-wrapper').toggleClass('blur');
             return false;
          });
        });
    </script>

I tried to change but it is not working well, do you know what it can be?

    
asked by anonymous 10.06.2018 / 16:53

1 answer

1

$(document).ready(function () {
  
          $('.trigger').click(function() {
             $('.modal-wrapper').toggle("open");
             $('.page-wrapper').toggle("blur");
          }); 
              return false; //aqui o return fica fora do click function
        });
.modal-wrapper{
		
position: absolute;
		width: 600px;
		height: 220px;
		top: 65px;
		background: #12C12B;
	}
		.page-wrapper{
		
position: absolute;
		width: 600px;
		background: #12C12B;
	}
<!-- essa linha é necessária -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><!--essalinhaénecessária--><divclass="page-wrapper">
  <a class="btn trigger" href="javascript:;">Click Me!</a>
 </div>
<!-- aqui coloquei sua div como hidden -->
<div class="modal-wrapper" hidden>
  <div class="modal">
    <div class="head">
      <a class="btn-close trigger" href="javascript:;"></a>
    </div>
     <div class="content">
    </div>
  </div>
</div>

Hi Day adpte how to say

    
10.06.2018 / 20:28