N
N
Nikita Guriev2020-08-04 18:00:55
css
Nikita Guriev, 2020-08-04 18:00:55

Why can't the bootstrap button's active be changed after the innerHTML command?

It's not easy to post a working example, as far as I understand it's because of ajax.
In general, I get certain data using the ajax method, from the .php file (the HTML code of the form is generated in the file ) I noticed that in the DOM, the buttons still have focus active classes. Normal operation (as it should be): Incorrect operation (as it really is): Phew, thank the gods! The function helped , instead of . For example:<div class="">...</div>
5f2977beee853493291634.gif
5f29780f0c088021769135.gif

insertAdjacentHTMLinnerHTML

dataDIV.insertAdjacentHTML("beforeend", allAps.html);

Where dataDIV is a div with data (you can specify any div),
beforeend is insertion after the last child element dataDIV and before the closing dataDIV tag ( more info ),
allAps.html is the HTML code to insert.

PS I understand the problem was because of the symbols "

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Guriev, 2020-08-05
@kvestor

Phew, thank the gods! The function helped insertAdjacentHTML, instead of innerHTML.
For example:

dataDIV.insertAdjacentHTML("beforeend", allAps.html);

Where dataDIV is a div with data (you can specify any div),
beforeend is insertion after the last child element dataDIV and before the closing dataDIV tag ( more info ),
allAps.html is the HTML code to insert.
PS I understand the problem was because of the symbols "

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question