I am trying to show a Progress Bar depending on the name. I have given the Progress Bars an id with the name and with a class “progressbar.” For example, $(‘#John.progressbar’) displays the Progress Bar for John. But, if I use the variable result instead nothing works.
function progress(json,name){
var result = "'" + "#" + name + "." + "progressbar" + "'";
$('result').progressbar({
value: json
});
}
When I do console.log it even shows the exact name but for some reason $('result').progressbar doesn’t work.
You are not using the result variable, you are using
'result'string…You wrote:
Notes:
#is for id selector not for name selector.'injavascriptis for start-end strings indicator. it’s just like"inC#\javaor most other languages you’re familiar with.