I am new to JQuery Mobile and trying to build a simple app. Part of the codes as follows:
<script type="text/javascript">
$(document).ready(function(){
$(".trycss").css({
'background': 'red' });
$.post("http://getcheckout.php",
function(data){
var CheckOutListHTML ='<p class="trycss"> HELLO</p>';
$('.class-ItemsList').append(CheckOutListHTML);
},"json");
});
</script>
<div data-role="page" id="id-ItemsPage">
<div data-role="header" data-position="fixed">
<h1>Items</h1>
</div><!-- /header -->
<div data-role="content">
<div class="class-ItemsList">
</div>
</div><!-- /content -->
</div><!-- /page -->
So, I am trying to use the "trycss" to style something I am creating dynamically. But it is not working. Can someone help?
Thanks.