So, I understand that mixing javascript into HTML is bad, even in head. But lets see this code (I want to remove items the from list)
.
.
.
<div>item1 <a href="#" onclick="return deleteThisItemById (1);">delete me</a><br />
<div>item4 <a href="#" onclick="return deleteThisItemById (4);">delete me</a><br />
<div>item5 <a href="#" onclick="return deleteThisItemById (5);">delete me</a><br />
.
.
.
This list is generated by PHP. deleteThisItemById() is in an external .js file. Is this still considered bad?
If so, what would be a canonical solution? jQuery is acceptable, as is raw javascript.
By the way, your HTML is invalid. You have improperly nested div tags.