mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 15:55:09 +00:00

After dispatching a "change" event due to the checked state being modified, we may have been removed from the layout tree. Make LayoutCheckBox protect itself to prevent this from crashing. Also, add a little test page for checkboxes. :^)
11 lines
330 B
HTML
11 lines
330 B
HTML
<html>
|
|
<input id=foo type=checkbox> This is a checkbox
|
|
<pre id=bar></pre>
|
|
<script>
|
|
var foo = document.getElementById("foo");
|
|
var bar = document.getElementById("bar");
|
|
foo.addEventListener("change", function() {
|
|
bar.innerHTML += foo.checked + "\n";
|
|
});
|
|
</script>
|
|
</html>
|