Don't try to listen to selector events if selector doesn't exist
This commit is contained in:
parent
f21f8a8ac9
commit
2016948119
1 changed files with 1 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
document.addEventListener("DOMContentLoaded", function (event) {
|
||||
var _selector = document.querySelector('#id_no_book');
|
||||
if (_selector === null) return;
|
||||
_selector.addEventListener('change', function (event) {
|
||||
if (_selector.checked) {
|
||||
document.querySelector('#id_title').value = "PAS DE LIVRE POUR CETTE CLASSE";
|
||||
|
|
Loading…
Reference in a new issue