SO-20170339

.trigger("create"); for new elements to get styled in jQuery Mobile

by Tushar Gupta

HTML

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<div data-role='page' id='pageone'>
    <input id='laskaInput' type='email' name='email' placeholder='[email protected]'>
    <p>Click body to test</p>
</div>

JavaScript

$(document).ready(function () {
    $('body').click(function () {
        $('#pageone').append("<input class='laskaInput' type='email' name='email' placeholder='[email protected]'>")
            .trigger("create");
    });
});