E
E
Eugene2019-12-13 15:00:14
JavaScript
Eugene, 2019-12-13 15:00:14

Why are classes and events not applied to newly created objects in JS?

A couple of questions.
1. I create a new table from an array through $.eachand .append(). I add , but
the table is still one-color. 2. I add a bootstrap tooltip in one of the elements , but it does not work on hover. Initialized via:<table>.addClass('table-stripped')
data-toggle="tooltip" title="some"

<script>
    $(document).ready(function () {
        $('[data-toggle="popover"]').popover();
    });
    $(function () {
        $('[data-toggle="tooltip"]').tooltip();
    });
</script>

at the end of the page

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2019-12-13
@Stalker_RED

1. Because striped with one p, for example.
2. because initialization must be done after adding, Andrew is right

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question