Is there a way to redirect to another page when I click on a div?

5

I have a div:

<div class="col-lg-4 col-sm-6"> //Essa aqui
       <section class="panel div-border-red">
              <div class="symbol red">
                  <i class="fa fa-eye"></i>
              </div>
              <div class="value">
                  <h1 class="count tkts-total" id="stock_danger"></h1>
                  <p>Falta de estoque</p>
             </div>
       </section>
</div>

I would like to know if you have any way to redirect to another page by clicking the (Without using AngularJS)     

asked by anonymous 07.10.2016 / 19:22

2 answers

9

You can do this easily by placing a link before starting div .

See it working here

Looking like this:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Esta linha acima é somente para importar o 'CSS' do Bootstrap -->

<a href="http://google.com.br"><div class="col-lg-4 col-sm-6"> //Essa aqui
       <section class="panel div-border-red">
              <div class="symbol red">
                  <i class="fa fa-eye"></i>
              </div>
              <div class="value">
                  <h1 class="count tkts-total" id="stock_danger"></h1>
                  <p>Falta de estoque</p>
             </div>
       </section>
</div></a>
    
07.10.2016 / 19:32
1

Set id to div and use the function click

$('#idDiv').click(function() { 
 document.location = 'http://suaurl.com/';
} );
    
07.10.2016 / 19:25