How to trigger a popup using HTML Attributes

Would you like to open, close or toggle a popup by clicking on a link or button? You can do so by utilizing HTML attributes.

In order to trigger a popup using HTML Attributes, you’ll need to find the popup ID and access the HTML code of the link/button you want to trigger the popup from.

Where to find the Popup ID?

To find the popup ID, first, go to FireBox > Popups and look at the last column named “ID”.

Available Commands

  • open (Show the popup)
  • close (Close the popup)
  • toggle (Toggle the popup)


The syntax can be found below using as an example a Popup with ID #1.

Show Popup using a button

<button data-fbox="1" data-fbox-cmd="open">
    Open Popup

Close Popup using a div

<div data-fbox="1" data-fbox-cmd="close">
    Close me!

Close Popup and Follow Link URL

<a data-fbox="1" data-fbox-cmd="close" data-fbox-prevent="0" href="">
    Close and Return to

Toggle Open/Close State

<a href="#" data-fbox="1">
    Toggle Open/Close State


The data-fbox attribute is not required when placing an HTML Element in a popup. FireBox will automatically understand that you want to trigger the actual popup and will close itself automatically.

<button data-fbox-cmd="close">
    Hide me!
Was this helpful?