O
O
ObehanProger2019-08-01 07:24:12
JavaScript
ObehanProger, 2019-08-01 07:24:12

How to check class change automatically?

It is necessary that all input type="text" fields constantly (or every millisecond) automatically check for the presence of the success class, and if all fields have such a class, the button color changes to red, and if not all or none of them - to grey.
The form:

<form id="post_form">
     <input id="title" class="post success">
     <input id="price" class="post">
     <input id="color" class="post invalid">
     <button>Создать</button>
    </form>

Suggest options on vue.js and jquery

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2019-08-01
@ObehanProger

constantly (or every millisecond) the presence of the success class was automatically checked

I think you should read more about view, especially the section on reactivity and the Observer pattern.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question