Q:

HTML checkbox won't display correctly with javascript

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>

A:

Here's the correction:
document.write('<input type="checkbox" ' + (data ? "checked" : "") + '>MyCheckBox');

You were missing the parentheses.
Also, don't put that inside <head>, like Teemu said, you can't render HTML there.

