Solved

How to get the selected spry tab with Jquery?

Posted on 2013-01-15
4
467 Views
Last Modified: 2013-01-15
Hello guys

When I click on the tab I need to get the selected spry tab with jquery, so that I can go on with my code. I can't figure out how to get the selected tab index.

<div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" id="tab1">Tab 1</li>
    <li class="TabbedPanelsTab" id="tab2">Tab 2</li>
    <li class="TabbedPanelsTab" id="tab3">Tab 3</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">Content 1</div>
    <div class="TabbedPanelsContent">Content 2</div>
    <div class="TabbedPanelsContent">Content 2</div>
  </div>
  <input type="submit" value="complete" class="complete">  
</div>

Open in new window


thanks
0
Comment
Question by:hidrau
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 38778132
$('.TabbedPanelsTab').on('click', function(){
  alert($(this).attr('id'));
});

Take a look at this fiddle I created: http://jsfiddle.net/slim81/6ZTJK/
0
 
LVL 1

Author Comment

by:hidrau
ID: 38778168
yeah, it was what I really wanted.

thanks very much
0
 
LVL 1

Author Closing Comment

by:hidrau
ID: 38778171
thanks
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38778202
do have jQuery running perfectly? no plugin conflict?

EDIT : ok, ok I'm late lol
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now