How to use HTML WrapAll Method in JQuery
This article describe about HTML WrapAll Method in JQuery.
HTML WrapAll() method in jQuery
- wrapAll() method wraps determined around the all HTML selected element.
Syntax
This is the simple syntax to use this method:
$(selector).wrapAll(wrappingElement)
|
Example
Following is a simple example a simple showing the usage of this method.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function ()
{
$("button").click(function ()
{
$("p").wrapAll("<div></div>");
});
});
</script>
<style type="text/css">
div{background-color:red;}
</style>
</head>
<body>
<p>This is a JQuery.</p>
<p>This is a .Netheaven.</p>
<button>Wrap all elements</button>
</body>
</html>
|
Output1

Output2

You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here