Sweetalert: Display a list of items?

Created on 31 Mar 2018  路  1Comment  路  Source: t4t5/sweetalert

Hi, I want to allow users make a search and then show the results on a list within the same sweetalert modal window. How can I do that? Inserting in complex DOM nodes feels quite difficult, or I just couldn't manage it :)

Most helpful comment

You can generate a node for the list like so:
const list = document.createElement('ul');
const listItem = document.createElement('li');
listItem.innerHTML = 'I am your content';
list.appendChild(listItem);

then in your call for sweet alert:

content: list,

>All comments

You can generate a node for the list like so:
const list = document.createElement('ul');
const listItem = document.createElement('li');
listItem.innerHTML = 'I am your content';
list.appendChild(listItem);

then in your call for sweet alert:

content: list,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daftspunk picture daftspunk  路  4Comments

mateuszjarzewski picture mateuszjarzewski  路  4Comments

mouro001 picture mouro001  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  4Comments

Untit1ed picture Untit1ed  路  5Comments