Macs
Macs

Reputation: 199

jquery mobile either text or icon showing not both

i am instantiating a button widget like so

var button = $('<div>')
 .buttonMarkup({
 icon: 'plus',
 corners: false,
 type: 'button',
})
 .attr('id', 'my-button')
 .text('start') //when this is added the icon vanishes
 .appendTo('#my-div');

the trouble is the when i add text no icon is shown. when i add no text icon is shown

is there anything i overlook

thanks a lot in advance

Upvotes: 1

Views: 41

Answers (1)

Omar
Omar

Reputation: 31732

You need to enhance the markup of the div using .button().

Demo

var button = $('<div>')
.buttonMarkup({
  icon: 'plus',
  corners: false,
  type: 'button',
})
 .attr('id', 'my-button')
 .text('start') //when this is added the icon vanishes
 .appendTo('#my-div').button();

Upvotes: 1

Related Questions