<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ГГ</title>
<style>
* {
margin:0;
padding: 0;
outline: none;
}
</style>
</head>
<body>
<input type="checkbox" id="checkbox">
<input type="text" id="text">
<script>
var checkbox = document.querySelector('#checkbox')
checkbox.onclick = function(){
document.querySelector('#text').value = checkbox.checked;
}
</script>
</body>
</html>