F
F
fenucss2015-10-04 14:03:33
JavaScript
fenucss, 2015-10-04 14:03:33

How to clear a div?

A number is entered into the text field, after the input, the contents of the div block are displayed, if the number changes (oninput), then another content of this div block is displayed, but if the number changes, the old content + new content is displayed. How can I clear a div block?
Example: entered the number 1 , a quote was displayed, changed 1 to 2 and another quote was displayed, but the problem is that the old quote needs to be cleared.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
littleguga, 2015-10-04
@fenucss

Here is a working example.

D
Dima Pautov, 2015-10-04
@bootd

https://learn.javascript.ru/modifying-document

V
Vitaly Inchin ☢, 2015-10-04
@In4in

Well, my implementation: ₸ Click ₸

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question