Skip to content
Related Articles

Related Articles

jQuery UI Selectable classes Option

Improve Article
Save Article
Like Article
  • Last Updated : 06 Dec, 2021

jQuery UI consists of GUI widgets, visual effects, and themes implemented using the jQuery JavaScript Library. jQuery UI is great for building UI interfaces for the webpages. It can be used to build highly interactive web applications or can be used to add widgets easily. 

The jQuery UI Selectable classes option is used to add some additional classes to the elements dynamically. 


  • Initialize selectable element with classes option:

        classes: {
            "ui-selectable": "class-name"


  • Set classes option after initialization:

    $( ".selector" ).selectable( "option", 
        "classes.ui-selectable", "class-name");
  • Return the classes option after initialization:

    var classes = $( ".selector" ).selectable(
        "option", "classes.ui-selectable" );

CDN Link: First, add jQuery UI scripts needed for your project.

<link rel=”stylesheet” href=”//”>
<script src=”//”></script>
<script src=”//”></script>



<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <link rel="stylesheet" 
    <script src=
    <script src=
    h1 {
        color: green;
    #list .ui-selecting {
        background: greenyellow;
    #list .ui-selected {
        background: green;
    .GFG {
        font-size: 20px;
        font-weight: bold;
    <h3>jQuery UI Selectable classes Option</h3>
    <ul id="list">
        <li>Data Structure</li>
            classes: {
                "ui-selected": "GFG"


Selectable classes Option


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!