.click broken down by class and ID?
I'm trying to do a function where a class of buttons can be broken down further by ID. Example:
- $(function() {
- $(".analyzer").click(function () {
- if = ("#ct50")
- $('#tabs').load('ct50tabs.html');
- $('.CT50').show();
- else if ("#status")
- $('#tabs').load('statustabs.html');
- $('.Status').show();
- else if ("#plus")
- $('#tabs').load('plustabs.html');
- $('.Plus').show();
- else if ("#statusconnect")
- $('#tabs').load('connecttabs.html');
- $('.Plus').show();
- else if ("#ct500")
- $('#tabs').load('ct500tabs.html');
- $('.CT500').show();
- else if ("#advantus")
- $('#tabs').load('advantustabs.html');
- $('.Advantus').show();
- else if ("#dca2000")
- $('#tabs').load('2000tabs.html');
- $('.DCA2k').show();
- else if ("#vantage")
- $('#tabs').load('vantagetabs.html');
- $('.Vantage').show();
- $('.analyzer').hide();
- });
Can that be done? If so, what am I doing wrong? Further, is there a better, simpler way?