Lathif Nya Safa Lathif Nya Safa - 9 months ago 47
Javascript Question

event on click not working in echo php

how to echo in php

iam try write sintax :
echo ' < div class=" city " onclick=" openCity(event,'London') " > ';
but event onclick not working

Answer Source

You have an issue with your quotes. You must escape the ones that suround your "London" arguement. Try this instead:

echo ' < div class=" city " onclick=" openCity(event,\'London\') " > ';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download