I need to add a value to href by adding a var. But it looks like i've got a syntax error somewhere. And can't figure out what's wrong.
var abra = "whatever";
$("a.confsbmt").attr('href','http://example.com/example2"+abra+"');
I need to add a value to href by adding a var. But it looks like i've got a syntax error somewhere. And can't figure out what's wrong.
var abra = "whatever";
$("a.confsbmt").attr('href','http://example.com/example2"+abra+"');
The string begins in single quotes so should end in single quotes to concatenate anything else on, if you want to use double quotes start with double quotes.
$("a.confsbmt").attr('href','http://example.com/example2'+abra);