Javatpoint Logo
Javatpoint Logo

jQuery wrap()

jQuery wrap() method is used to wrap specified HTML elements around each selected element. The wrap () function can accept any string or object that could be passed through the $() factory function.

Syntax:

Parameters of jQuery wrap() method

Parameter Description
WrappingElement It is a mandatory parameter. It specifies what HTML elements to wrap around each selected element. Its possible values are:
  • HTML elements
  • jQuery objects
  • DOM elements
Function(index) It is an optional parameter. It specifies a function that returns the wrapping element.
  • Index: It provides the index position of the element in the set.

Example of jQuery wrap() method

Let's take an example to demonstrate the jQuery wrap() method.

Test it Now

jQuery wrap() example 2

Test it Now
Next TopicjQuery serialize()




Let's Work Together!

Javatpoint is passionate to offer better content to the world. Please mail your contribution to contribute@javatpoint.com. We will show your name and create your user profile. You can contribute the following things:
  • Article on Any Topic (which is not available on Javatpoint)
  • Your Interview Experience on Company
  • Company Interview Questions with Answers
  • Recruitment Process of Company
  • Programs, and Algorithm
  • Videos
  • Test Paper
  • Improve Article

Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials