I want to nest a button that performs an Ajax action that is between <a>
tags.
The whole container should act as a link to a separate webpage while the "favorite" button will perform an unrelated Ajax action. Unfortunately, this is not able to be done because <button>
cannot be nested inside an <a>
tag.
Is there a simple workaround to achieve to this effect?
Current code:
<a class="button7" onmouseover="displayFavorite('000')" onmouseout="hideFavorite('000')" href="http://www.example.com">
Math 141
<button id='000' class="button8" onclick="favorite('000')">Favorite</button>
<ul>
<li><strong>Description</strong> Calculus 1 and Calulus 2</li>
<li><strong>Instructor</strong> Boon Ong</li>
<li><strong>Documents</strong> 17</li>
</ul>
</a>
EDIT: Please note, the AJAX was just additional information, its not related to the question.