Is it possible to replace basic javascript (ex. getElementById, addEventListener, checked, forEach ...) with py-script Python codes ?
I want to work with html without learning JS, even ChatGPT didn't help to generate python equivalent code.
ex:
<body>
<input class="checkbox-input" id="oranges" type="radio" />
<input class="checkbox-input" id="bananas" type="radio" />
<a href="#" id="clear-button"> Clear</a>
<script>
document.getElementById('clear-
button').addEventListener('click', function () {
["oranges", "bananas"].forEach(function(id) {
document.getElementById(id).checked = false;
});
return false;
})
</script>
</div>
</body>