jQuery UI Widgets › Forums › Editors › Button, RepeatButton, ToggleButton, LinkButton › What's the best way to put an image on a button?
This topic contains 1 reply, has 2 voices, and was last updated by Peter Stoev 8 years, 1 month ago.
I don’t see in the demo’s an example of having an image on a button, which I think is a common use case and one that I need in a current project. Can you describe the best way to accomplish this?
In order to create a Button with Image, you need to use a DIV instead of INPUT tag.
The following is a HTML markup for a button with image.
<div style="width: 100px; height: 25px;" id='jqxButton'> <img style='float: left; margin: 4px;' src='../../images/numberinput.png' /> <div style='float: left; margin: 4px;'> Button</div></div>
The script that creates the button is:
Hope this helps you.
You must be logged in to reply to this topic.