[jQuery] jQuery/ HTML help needed
Alright, heres the situation: I'm creating a tabbed box with jQuery
and with some HTML tricks. The code that I came up with works great
but is considered invalid markup by W3 standards.
HTML:
<div id="tab_links">
<a href="#" id="'#tab_1'" class="active">slide 1</a>
<a href="#" id="'#tab_2'">slide 2</a>
<a href="#" id="'#tab_3'">slide 3</a>
</div>
<div id="tabs">
<div id="tab_1" style="display:block;">
slide 1
</div>
<div id="tab_2" style="display:none;">
slide 2
</div>
<div id="tab_3" style="display:none;">
slide 3
</div>
</div>
The script:
var activeTab = $(this).attr('id');
$(activeTab).fadeIn(500);
Well thats not all of it, but only what you should need to help me
out. The thing is that the "id" value can only start with letters
(according to W3). I, though, used single quote marks so that it
worked with the second line of script that I showed you.
How could I change the variable so that it included single quote
marks? Is there another workaround? Thanks in advance.