I am trying to live update content on the page then the user clicks buttons.
content section:
<p class="chapterContent"><?php echo $chapterContent[$chapter]; ?></p>
Here are my buttons:
<span class="navigationItem"><a href="" onclick= <?php $chapter = 0; ?>>1</a></span>
<span class="navigationItem"><a href="" onclick= <?php $chapter = 1; ?>>2</a></span>
$chapterContent is an array with different strings. So then user clicks on 1 it loads $chapterContent[0] if he clicks 2 it loads $chapterContent[1] What I have does not work and how can I do it that the html code in class .chapterContent reloads with correct chapter? Any help appreciated!