Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function newToast(Header, Body) {
- var toast = {}
- toast.Header = Header
- toast.Body = Body
- toast.Hide = function() {
- // todo, hide
- }
- var header = document.getElementById("t-header")
- var body = document.getElementById("t-body")
- header.innerHTML = toast.Header
- body.innerHTML = toast.Body
- $('.toast').toast('show');
- return toast
- }
- let toast = newToast("Header Test", "Body Test")
- <div class="toast" data-autohide="false" role="alert" aria-live="assertive" aria-atomic="true" data-delay=3000 id="toast">
- <script>
- $(document).ready(function() {
- $(".toast").toast("show");
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement