Hi, i have a function like this: function test(s, t, c) { var Ss = "#" + s; var S = "#" + s + cod; if(t == 1) { $(S).empty().html("<a href='#' onClick='test("+s+", 0, "+c+")'>-</ a> "+s); $(Ss).show(); } else { $(S).empty().html("<a href='#' onClick='test("+s+", 1, "+c+")'>+</ a> "+s); $(Ss).hide(); } }
Can you guys understand what im trying to do... I wanna generate the HTML with the same function but with some changes, i can do all, but i dont know why the "+s+" doesnt work. theres no value, i tried to use an alert for "s" and it says object, so the function only work first time when i load the page, i think its something wrong with the format: $(S).empty().html("<a href='#' onClick='test("+s+", 0, "+c+")'>-</ a> "+s); $(S).empty().html("<a href='#' onClick='test("+s+", 1, "+c+")'>+</ a> "+s);