In the last Question I asked, about alerting Variables out.
Can be found here.
I fixed it and it works now.
With the knowledge I gained from the last answers I wanted to do an output of an <a> </a>
with Variables in it.
But am not able to do this.
I did try various types of escaping which came to my mind. None Helped.
So I´m going to ask you guys again: How can I fix this, to print out my Variables correctly?
$('<a>'
ID von '' + counter + ''
XPosition '' + containerX + '', YPosition '' + ContainerY '</a>').appendTo($('#textuelledarstellung'));
Context:
var counter = 0;
$('#divfuerimage').on('click', function (evt) {
counter = counter + 1;
var containerX = evt.pageX - $(this).offset().left,
containerY = evt.pageY - $(this).offset().top;
alert('ID von' + counter + ' XPosition' + containerX + ''
, YPosition' + containerY); //this is working
$('<a>'
ID von '' + counter + ''
XPosition '' + containerX + '', YPosition '' + ContainerY '</a>').appendTo($('#textuelledarstellung'));
//this not