Shouldn't this javascript just display an unchecked checkbox followed by the text "MyCheckBox"? Instead, it's just displaying "checked."
<html>
<head>
<script>
var data = false;
document.write('<input type="checkbox" ' + data ? "checked" : "" + '>MyCheckBox');
</script>
</head>
<body>
</body>
</html>
headelement is not purposed to render any HTML. Also the ternary should be wrapped in the parentheses within a string concatenation.document.write('<input type="checkbox" ' + (data ? "checked" : "") + '>MyCheckBox');just added parantheses<head>, only metadata content permitted.