Here's the code:
<nav>
<ul id="alphabet" class="pagination">
<li><a href="#" onClick="alert(#);">#</a></li>
<?php
$letterArray = str_split(strtoupper("abcdefghijklmnopqrstuvwxyz"));
foreach ($letterArray as $s) {
echo '<li><a href="#" onClick="alert('.$s.');">'.$s.'</a></li>';
}
?>
</ul>
</nav>
When I click a letter, I get, for example:
Uncaught ReferenceError: N is not defined
And if I surround $s inside alert with '' or "", it just alerts "$s". How can I "transfer" this variable to Javascript as an actual string instead of the variable literally?