Skip to content

Commit 7677a95

Browse files
author
Tom Boutell
committed
jquery-get-outer-html: small yet useful
1 parent a98ce0c commit 7677a95

File tree

5 files changed

+62
-74
lines changed

5 files changed

+62
-74
lines changed

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
1-
# jquery-radio
1+
# jquery-get-outer-html
22

3-
<a href="http://apostrophenow.org/"><img src="https://raw.github.com/punkave/jquery-radio/master/logos/logo-box-madefor.png" align="right" /></a>
3+
<a href="http://apostrophenow.org/"><img src="https://raw.github.com/punkave/jquery-getOuterHTML/master/logos/logo-box-madefor.png" align="right" /></a>
44

5-
`jquery-radio` makes it easy to get or set the current value of a group of radio buttons, filling a gap in jQuery's `$.val()`.
5+
`jquery-get-outer-html` provides a simple way to get the "outer HTML" for an element, including the element itself, even in browsers that do not support that natively. Unlike other plugins it does not include a setter for outerHTML, so it is best suited to those who do not need the extra code for a setter in their project.
66

77
## How to Use
88

9-
Select *all* of the buttons in the group and call `.radio()`:
10-
11-
// Check the box with value="5"
12-
$('input.my-radio-group').radio(5);
13-
// Get the value of the checked box
14-
var value = $('input.my-radio-group').radio();
15-
16-
This example assumes you have several radio buttons that all have the `.my-radio-group` class.
9+
$('.my-element').getOuterHTML();
1710

1811
### Requirements
1912

20-
You need jQuery, of course. `jquery-radio` is actively supported with jQuery 1.9 and 2.0 but should work fine with older versions.
13+
You need jQuery, of course. `jquery-getOuterHTML` is actively supported with jQuery 1.9 and 2.0 but should work fine with older versions.
2114

2215
## About P'unk Avenue and Apostrophe
2316

24-
`jquery-radio` was created at [P'unk Avenue](http://punkave.com) for use in Apostrophe, an open-source content management system built on node.js. If you like `jquery-radio` you should definitely [check out apostrophenow.org](http://apostrophenow.org). Also be sure to visit us on [github](http://github.com/punkave).
17+
`jquery-get-outer-html` was created at [P'unk Avenue](http://punkave.com) for use in Apostrophe, an open-source content management system built on node.js. If you like `jquery-get-outer-html` you should definitely [check out apostrophenow.org](http://apostrophenow.org). Also be sure to visit us on [github](http://github.com/punkave).
2518

2619
## Support
2720

28-
Feel free to open issues on [github](http://github.com/punkave/jquery-radio).
21+
Feel free to open issues on [github](http://github.com/punkave/jquery-get-outer-html).
2922

30-
<a href="http://punkave.com/"><img src="https://raw.github.com/punkave/jquery-radio/master/logos/logo-box-builtby.png" /></a>
23+
<a href="http://punkave.com/"><img src="https://raw.github.com/punkave/jquery-get-outer-html/master/logos/logo-box-builtby.png" /></a>
3124

get-outer-html.jquery.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "get-outer-html",
3+
"title": "Get Outer HTML",
4+
"description": "Get Outer HTML lets you get the \"outer HTML\" of an element, including the element itself, even in browsers that do not natively support that. This is a very small plugin which does not include a setter for those who don't need a setter.",
5+
"keywords": ["get-outer-html", "dom", "polyfill" ],
6+
"version": "0.1.0",
7+
"author": {
8+
"name": "P'unk Avenue",
9+
"url": "http://punkave.com/"
10+
},
11+
"maintainers": [
12+
{
13+
"name": "Tom Boutell",
14+
"email": "tom@punkave.com",
15+
"url": "http://punkave.com"
16+
},
17+
{
18+
"name": "Kyle Stetz",
19+
"email": "kyle@punkave.com",
20+
"url": "http://punkave.com"
21+
}
22+
],
23+
"licenses": [
24+
{
25+
"type": "MIT",
26+
"url": "https://github.com/punkave/jquery-get-outer-html/LICENSE.md"
27+
}
28+
],
29+
"bugs": "https://github.com/punkave/jquery-get-outer-html/issues",
30+
"homepage": "https://github.com/punkave/jquery-get-outer-html",
31+
"docs": "https://github.com/punkave/jquery-get-outer-html",
32+
"download": "https://github.com/punkave/jquery-get-outer-html",
33+
"dependencies": {
34+
"jquery": ">=1.9"
35+
}
36+
}

jquery.get-outer-html.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// get-outer-html: a jQuery plugin that makes it easy to get the
2+
// outer HTML of an element, including the element itself.
3+
//
4+
// Copyright 2013 P'unk Avenue LLC
5+
//
6+
// Please see:
7+
//
8+
// https://github.com/punkave/jquery-get-outer-html
9+
//
10+
// For complete documentation.
11+
12+
(function( $ ){
13+
$.fn.getOuterHTML = function() {
14+
var wrapper = $('<div></div>');
15+
wrapper.append(this.clone());
16+
return wrapper.html();
17+
};
18+
})( jQuery );

jquery.radio.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

radio.jquery.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)