javascript - Using a variable as a classname -
i trying put class name stored in variable jquery want class be, should change class affected depending on parameter passed through url query string. have built class name , stored in 'param' variable below.
var param = '".' + "proj" + location.search.substring(6) + '"'; $(param).css('display', 'inline');
and want change css on class inside of not seem work me. perhaps because tries change css of variable rather inside of it. if not how can solve or if so, there better way go this?
you're confusing string literal enclosed double quotes "
, while not case. remove them
var param = '.' + "proj" + location.search.substring(6);
Comments
Post a Comment