?
Solved

How to get the selected spry tab with Jquery?

Posted on 2013-01-15
4
Medium Priority
?
483 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 2000 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
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 the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

741 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