I am building a table using css and a combination of <a>
tags with <span>
s something like :
<a class='header'>
<span>User ID</span>
<span>Name</span>
<span></span>
</a>
<a href='somesite.php'>
<span>7</span>
<span>Ofek</span>
<span><button type="button" onclick="somefunc()">Add to Favourites</button></span>
</a>
the results looks something like that :
Now my problem is that when i click the button i still get redirected to somesite.php, and the function somefunc() never gets called, i seen somewhere that a button cant be nested inside a span, so whats the alternative to make this work? i want that whenever user click on the line it will redirected him to somesite.php, but not when he presses the button, then i only want the func somefunc() to be called.