jQuery UI Resizable option() Method
Last Updated :
23 Jul, 2025
jQuery UI is a web-based technology and consists of GUI widgets, visual effects, and themes implemented using the jQuery, JavaScript Library. jQuery UI is the best tool for building UI interfaces for the webpages. It can also be used to build highly interactive web applications or can be used to add widgets easily.
In this article, we are going to learn the jQuery Mobile Resizable option() method. Using this method, we can get, set or update any parameter’s value of the Resizable widget. We can also get all the options as key-value pairs using this method.
Syntax:
1. If the user wants any option’s value, the option name should be passed in the option(optionName) method. The optionName should be a string type.
var isEnhanced = $("Selector").resizable("option", "enhanced");
Parameter:
- optionName: This parameter is the input that we need to pass in the form of a string for which we need to get the value.
Return type: We get the respective return value based on the option data type.
2. To get all the options as the key-value pairs, you just need to call the option() method with no parameter is passed to the method.
var options= $("Selector").resizable("option");
Parameter: The option() method with no parameter is passed to the method.
Return type: This method returns the list of key-value pairs of all the options as optionName-optionValue pairs set.
3. To set the value of any option, you just need to call the option(optionName, value) with the optionName and the value as the parameters.
$("Selector").resizable("option", "enhanced", "false");
Parameters:
- optionName: The option method required the option name as the first parameter and this parameter is of string type.
- value: The option method required the option’s name as the second parameter and this parameter is of string type.
4. We can also set multiple options instead of only one, you just need to call the option(options) method where options are the list of options.
$("Selector").resizable("option", {enhanced: false, disabled: true});
Parameter:
- option: It is the map of the optionName-value pairs as input to set the options corresponding to the values passed, which is of the object type.
CDN Link: Following are some jQuery Mobile scripts that you will be needed for your project so add these scripts into your project.
<link rel=”stylesheet” href=”https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css%E2%80%9D>
<script src=”https://code.jquery.com/jquery-1.12.4.js%E2%80%9D></script>
<script src=”https://code.jquery.com/ui/1.12.1/jquery-ui.js%E2%80%9D></script>
Example: This example describes the uses of the jQuery Mobile Resizable option() method.
HTML
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href=
"https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js">
</script>
<style>
h1 {
color: green;
}
.container {
width: 320px;
}
#resizable-div {
float: left;
}
#resizable-div {
width: 150px;
height: 150px;
text-align: center;
border: 2px solid black;
}
</style>
<script>
$(function () {
$("#btn").on('click', function () {
var options = $("#resizable-div").resizable("option");
document.getElementById('GFG').innerHTML +=
"No of key/value pair present : " +
Object.keys(options).length;
});
});
$(function () {
$("#resizable-div").resizable();
$("#resizable-div").resizable('enable');
});
</script>
</head>
<body>
<center>
<h1>GeeksforGeeks</h1>
<h3>jQuery UI Resizable option() Method</h3>
<div class="container">
<div id="resizable-div">
<h3 class="gfg">I'm Enable</h3>
</div>
</div>
<br>
<input type="button" id="btn"
style="width: 200px; height: 40px;"
value="Option">
<h4><span id="GFG"></span></h4>
</center>
</body>
</html>
Output:
jQuery Mobile Resizable option() method
Reference: https://api.jqueryui.com/resizable/#method-option
Similar Reads
jQuery Tutorial jQuery is a lightweight JavaScript library that simplifies the HTML DOM manipulating, event handling, and creating dynamic web experiences. The main purpose of jQuery is to simplify the usage of JavaScript on websites. jQuery achieves this by providing concise, single-line methods for complex JavaSc
8 min read
Getting Started with jQuery jQuery is a fast lightweight, and feature-rich JavaScript library that simplifies many common tasks in web development. It was created by John Resign and first released in 2006. It makes it easier to manipulate HTML documents, handle events, create animations, and interact with DOM(Document Object M
4 min read
jQuery Introduction jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM). jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax interactions, and cross-browser Java
7 min read
jQuery Syntax The jQuery syntax is essential for leveraging its full potential in your web projects. It is used to select elements in HTML and perform actions on those elements.jQuery Syntax$(selector).action()Where - $ - It the the shorthand for jQuery function.(selector) - It defines the HTML element that you w
2 min read
jQuery CDN A Content Delivery Network (CDN) is a system of distributed servers that deliver web content to users based on their geographic location. Including the jQuery CDN in your project can improve the performance, enhance reliability, and simplify maintenance.What is a jQuery CDN?A jQuery CDN is a service
4 min read
jQuery Selectors
JQuery SelectorsWhat is a jQuery Selector?jQuery selectors are functions that allow you to target and select HTML elements in the DOM based on element names, IDs, classes, attributes, and more, facilitating manipulation and interaction. Syntax: $(" ")Note: jQuery selector starts with the dollar sign $, and you encl
5 min read
jQuery * SelectorThe jQuery * selector selects all the elements in the document, including HTML, body, and head. If the * selector is used together with another element then it selects all child elements within the element used. Syntax: $("*")Parameters: *: This parameter is used to select all elements.Example 1: Se
1 min read
jQuery #id SelectorjQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. Elaborating on the terms, it simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Aja
1 min read
jQuery .class SelectorThe jQuery .class selector specifies the class for an element to be selected. It should not begin with a number. It gives styling to several HTML elements. Syntax: $(".class") Parameter: class: This parameter is required to specify the class of the elements to be selected.Example 1: In this example,
1 min read
jQuery Events
jQuery Effects
jQuery HTML/CSS
jQuery Traversing