Suppose there are two Input (Date of addition and date of deletion) if only the Date of addition was filled in, then there is a picture in the form of a check mark, and if the Date of deletion is still filled in, then a cross. How to implement such a change of pictures on JavaScipt. I apologize for not adding my code (I simply don’t have it, I don’t know how to do it).
- ajax - function saccess - if I'm not mistaken - user33274
|
1 answer
The logic is as follows:
let input_value_dts = null; let input_value_dte = null; let curr_image = ""; if(!input_value_dts || !input_value_dte){ console.log("Одна из дат не заполнена!"); // тут метод смены картинки на крестик curr_image = "/bad.jpg" } else { console.log("Обе даты присутствуют!"); // а тут смены на галочку curr_image = "/good.jpg" } |