I'm wondering how I can get the name of an element when it is clicked in PHP, but all elements have the same name for this instance...
PHP:
<?php
$playlist_names = array("Chill", "Groovy", "Pastasauce", "Dank Songs", "Katy Perry");
for ($i = 0; $i < count($playlist_names); $i++) {
echo "<a href=\"\" class=\"playlist-name\" name=\"$x\">$playlist_names[$i]<img src=\"http://i.imgur.com/pLLny9D.png\" class=\"gear-icon\" /></a>";
}
?>
What I'm trying to do is when "playlist-name" is clicked - It will return the playlist name in a different div with the text "Editing [Name of the playlist here]"
This does seem like a simple problem, but as always thanks for helping out!