I have a function in jQuery and it does not work as expected
function hideShowTextBox(tabName, index, tabContainer) {
var tabIndex = index + 1;
var dropDownId = tabContainer + '_' + tabName + '_IncomeDetails' + tabIndex + '_dpEmploymentStatus';
//this l开发者_Go百科ine gives a blank value..What may be the problem???
alert($(dropDownId + ' option:selected').text());
}
ID selectors must begin with the #
character, e.g.#foo
. Try:
var dropDownId = '#' + tabContainer + '_' + tabName + '_IncomeDetails' + tabIndex + '_dpEmploymentStatus';
精彩评论