I once read that the following coding technique is considered bad:
text link <
text link
The best approach is called unobtrusive JavaScript and it basically means the separation of behaviour (JS) from structure (HTML), similar to how CSS is a separation of presentation from structure and also for the same reasons.