I have 2 different links with inline js added.
I would like to add both to a single inline onclick.
Here are the two separate one:
<a href="#" onclick=\'$("#id").toggle();\'>
<a href="#" onclick="myvar = '1';">
And this is what I would like to do:
<a href="#" onclick="$("#id").toggle();myvar = '1';">
How could I do this?
<a href="#" onclick="$('#id').toggle();myvar = '1';">. Did you see you have problems with quotes ?$("#id"), but that would mean that you'd continue to use inline javascript, which is pretty much always the wrong approach.