jquery-uijquery-ui-button

How to add icons only to certain buttons?


I currently have this code on my page:

$( ":button").button({
                icons: {
                    primary: "ui-icon-circle-plus"
                }
            });

That makes all of the buttons have plus signs.

Is there a way to only make certain buttons have plus signs, but have the rest of the buttons not have plus signs?


Solution

  • Assign the buttons to a class and use

    $('.class:button')
    

    instead of

    $(':button')