Open Popup Programmatically

Open a popup with a click
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Open Popup Programmatically</title>
  <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
  <script src='//api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.js'></script>
  <link href='//api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.css' rel='stylesheet' />
  <!--[if lte IE 8]>
    <link href='//api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.ie.css' rel='stylesheet'>
  <![endif]-->
  <style>
    body { margin:0; padding:0; }
    #map { position:absolute; top:0; bottom:0; width:100%; }
  </style>
</head>
<body>
<style>
#open-popup {
    position:absolute;
    top:5px;
    right:5px;
}
</style>
<div id='map'></div>
<button id='open-popup'>open popup</button>
<script>
var map = L.mapbox.map('map', 'examples.map-zr0njcqy');

// wait until the markers are loaded, so we know that `map.markerLayer.eachLayer`
// will actually go over each marker
map.markerLayer.on('ready', function(e) {
    // when a user clicks the button run the `clickButton` function.
    // Thanks to function hoisting in Javascript, we can define the function
    // after we reference it here.
    document.getElementById('open-popup').onclick = clickButton;
});

function clickButton() {
    map.markerLayer.eachLayer(function(marker) {
        // you can replace this test for anything else, to choose the right
        // marker on which to open a popup. by default, popups are exclusive
        // so opening a new one will close all of the others.
        if (marker.feature.properties.title === 'Capital Pride Parade') {
            marker.openPopup();
        }
    });
}
</script>
The code and documentation to mapbox.js is hosted on GitHub where you can contribute changes and improvements.