if($(currentTab+' form.dataform').attr('name') !== undefined)
var $selectedTab = $(currentTab+' form.dataform').attr('name');
else
var selectedTab = '0';
alert($(selectedTab)); Gives me an object. I need string. How?
if($(currentTab+' form.dataform').attr('name') !== undefined)
var $selectedTab = $(currentTab+' form.dataform').attr('name');
else
var selectedTab = '0';
alert($(selectedTab)); Gives me an object. I need string. How?
Drop the $() around the selectedTab, and remove the $ from the variable definition.
if($(currentTab+' form.dataform').attr('name') !== undefined)
var selectedTab = $(currentTab+' form.dataform').attr('name');
else
var selectedTab = '0';
alert(selectedTab);