$(document).ready(function() {
$(".navbutton").click(function() {
if ($(".1").hasClass("chosenbutton")) {
op1 = $("#suboptions").html();
}
if ($(".2").hasClass("chosenbutton")) {
op2 = $("#suboptions").html();
}
if ($(".3").hasClass("chosenbutton")) {
op3 = $("#suboptions").html();
}
if ($(".4").hasClass("chosenbutton")) {
op4 = $("#suboptions").html();
}
if ($(".5").hasClass("chosenbutton")) {
op5 = $("#suboptions").html();
}
if ($(".6").hasClass("chosenbutton")) {
op6 = $("#suboptions").html();
}
$(".navbutton").removeClass("chosenbutton");
$(this).addClass("chosenbutton");
});
$(".1").click(function() {
$("#suboptions").html(op1);
});
$(".2").click(function() {
$("#suboptions").html(op2);
});
$(".3").click(function() {
$("#suboptions").html(op3);
});
$(".4").click(function() {
$("#suboptions").html(op4);
});
$(".5").click(function() {
$("#suboptions").html(op5);
});
$(".6").click(function() {
$("#suboptions").html(op6);
});
});
This works for I.E. but not firefox because firefox doesn't save the results of checkboxes in HTML, it stores it in memory somewhere. Is there any way I can do this without using more variables? Also, is there any way I can do this without using the variables I've already used, because they make the code look ugly. Thanks, guys.

New Topic/Question
Reply



MultiQuote


|