Mihir
Mihir

Reputation: 2074

How to open nested div with href

I want to open nested div on a href click -

  <div data-role="page" id="mainpage">
  <a href="#inside" id="touchstartcss">School News</a>
  </div>

  <div data-role="page" id="basePage">
  <div data-role="page" id="inside" >
  </div>
  </div>

but the inside div is not opening.

Upvotes: 0

Views: 102

Answers (2)

rajesh kakawat
rajesh kakawat

Reputation: 10896

try something like this

$('#touchstartcss').click(function(){
    $(this.href).show();
})

Upvotes: 0

Nouphal.M
Nouphal.M

Reputation: 6344

Try

jQuery

$('#touchstartcss').click(function(e){
  e.preventDefault();
   $('#inside').show();
});

Css

#inside{display:none;}

Upvotes: 1

Related Questions