Can someone help me solve this syntax error? : <p>Hi I am trying the code below on a php page. I keep getting syntax error due to the single quotes around the parameter 'London' of the function openCity() shown below.</p>

<pre><code>echo '&lt;button class="tablinks" onclick="openCity(event, 'London')"&gt;London&lt;/button&gt;';
</code></pre>

<p>If I remove the single quotes covering 'London' and add double quotes there, the function doesn't work as expected. What am I not seeing? Is there a way to fix this?</p>

<p>The openCity() javacript function is shown below.</p>

<pre><code>function openCity(evt, cityName) {
  var i, tabcontent, tablinks;
  tabcontent = document.getElementsByClassName("tabcontent");
  for (i = 0; i &lt; tabcontent.length; i++) {
    tabcontent[i].style.display = "none";
  }
  tablinks = document.getElementsByClassName("tablinks");
  for (i = 0; i &lt; tablinks.length; i++) {
    tablinks[i].className = tablinks[i].className.replace(" active", "");
  }
  document.getElementById(cityName).style.display = "block";
  evt.currentTarget.className += " active";
'''


What I am trying to do is when a user clicks the button, it shows a block of elements (Like a tabs).
</code></pre>
