pujitav pujitav - 23 days ago 16
jQuery Question

how can i create a button like bookmark with star image along with listview?

i want to create a button or check box with an image along with listview.I have a list of items which are retrieved from the databse using jquery for each item there should be an image button,the image could be star,i want to implement a concept like bookmark..
i want to add in this list,how can i do this??

var htmlStr = '<li><a><h3 class="ui-li-heading">'+row['Word']+'</h3><p class="ui-li-desc">'+row['Type_Of_Word']+'</p></a></li>';

Answer Source

add your own icon using css:

.ui-state-default  .ui-icon-mystar {
  background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Full_Star_Red.svg/64px-Full_Star_Red.svg.png); 
   background-size: 100%;
    
}​

in javascript:

$('#starbutton').button({icons: {primary:'ui-icon-mystar'}});​

in html:

<a href="#" id="starbutton">Bookmark</a>​

working sample: