Open multiple SharePoint Modal Popup Dialog With HTML option
I think you can easily implement multiple SharePoint Modal Popup Dialog by passing a parameter in openDialog();
function as the following:
<a href="#" onclick="openDialog('option1');">Click Here</a>
<script>
function openDialog(option) {
var divElement;
if(option == 'option1' ) {
divElement = document.createElement('div');
divElement.innerHTML = 'enter your content here';
} else if (option == 'option1')
{
// add you second HTML code here, etc.
divElement = document.createElement('div');
divElement.innerHTML = 'enter your content here';
}
var options = {
html: divElement,
title: 'Yout title',
allowMaximize: false,
showClose: true,
width: 300,
height: 100
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
</script>
Regarding your second question, yes, you can use a button instead of a link using the below input
tag
<input type="button" onclick="openDialog();" value="Click Here">
For more details, Please check