<script type="text/javascript">
function test() {
alert('<span>blah<span>');
}
</script>
<a href="#" onclick="test();">First</a><br />
<a href="#" onclick="alert('<span>blah<span>');">Second</a><br />
Third: <span>blah<span>
Demo: http://jsfiddle.net/LPYTZ/
Why is the first result different? Are <script>
tags somehow excluded from entity conversion?