Quantcast
Channel: DaniWeb Solved Topics
Viewing all articles
Browse latest Browse all 587

Display div content in Sweet Alert

$
0
0

hi everyone,

i want to display content of div into sweet alert message and here is my code

<?php 

echo '<script>
var swal2container = $("#swal2container").text();

setTimeout(function() {
swal({
title: "Alert!",
text: swal2container,
type: "error"
}, function() {
window.location = "index.php";
});
}, 100);




</script>';


?>

<div id="swal2container">test</div> 

i still cant get the content of swal2container when sweet alert . Anyone can help meh?


Viewing all articles
Browse latest Browse all 587

Trending Articles