Dynamic buttons

Jquery Mobile

by Omar X

HTML

<div id="test">
<a href="#" data-role="button" id="static" data-theme="b">Click to create button</a>
</div>

JavaScript

// Append new button
var i = 1;
$('#static').on('click', function () {
    $('#test').append('<a href="#" data-role="button">Dynamic Button ' + i + '</a>').trigger('create');
    i++;
});