I have a code that is a mmix of html and js. I cannot get it correct.
location.description + '<br><a href="javascript:void(0);" onclick="showStreet;">ShowStreet </a><br>'+ location.lat + '<br> + location.lng
Can anyone help me with it?
I have a code that is a mmix of html and js. I cannot get it correct.
location.description + '<br><a href="javascript:void(0);" onclick="showStreet;">ShowStreet </a><br>'+ location.lat + '<br> + location.lng
Can anyone help me with it?
location.description + '<br><a href="javascript:void(0);" onclick="showStreet();">ShowStreet </a><br>'+ location.lat + '<br>' + location.lng
You have to call a function inside onclick and there you were missing parenthesis. And also a single quote after the last <br>
You have two problems in that:
' after location.lat + '<br>showStreet with ()Try this:
location.description + '<br><a href="javascript:void(0);" onclick="showStreet();">ShowStreet </a><br>'+ location.lat + '<br>' + location.lng
Note: You might want to add the return keyword for your function depending on whether you want to cancel it at some point.
Did you mean onclick="showStreet()" (instead of onclick="showStreet;")?
From your question, it's unclear what the problem is.