5

I just integrated my first snippet on an existing post, nice work.

I put it on this post: https://stackoverflow.com/a/19932511/731138

enter image description here

Code appears without language distinction, with a small space as separation:

$('#test').click(function() {
    alert("Checkbox state (right method 1) = " + $('#test').is(':checked'));
    alert("Checkbox state (right method 2) = " + $('#test').prop('checked'));
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Check me: <input id="test" type="checkbox" />

I think it would be more readable if the language for each code were explicitly given:

JavaScript

$('#test').click(function() {
    alert("Checkbox state (right method 1) = " + $('#test').is(':checked'));
    alert("Checkbox state (right method 2) = " + $('#test').prop('checked'));
});

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Check me: <input id="test" type="checkbox" />
4

<html/>
c:ss
javascript.().()
and
j$q$u$e$r$y
are all very distinct formatted languages that I think they are quite easy to tell apart without writing
LANGUAGE
on top of each one separately.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .