Skip to content
Browse files

reformat readme.md

  • Loading branch information...
1 parent ab84f9a commit 3926841bb3eeb4680ea6e4a118c8a8e014a81a06 @danheberden committed Feb 1, 2012
Showing with 16 additions and 10 deletions.
  1. +16 −10 Readme.md
View
26 Readme.md
@@ -1,26 +1,32 @@
$.fn.serializeObject makes an object out of form elements inside of the specified item.
-Example:
+Example:
+```html
<div id="test">
- <input name="text1" value="txt-one" />
- <input type="checkbox" name="top[child][]" value="1" checked="checked" />
- <input type="checkbox" name="top[child][]" value="2" checked="checked" />
- <input type="checkbox" name="top[child][]" value="3" checked="checked" />
-
- <select name="another[select]">
- <option value="opt"></option>
- </select>
+ <input name="text1" value="txt-one" />
+ <input type="checkbox" name="top[child][]" value="1" checked="checked" />
+ <input type="checkbox" name="top[child][]" value="2" checked="checked" />
+ <input type="checkbox" name="top[child][]" value="3" checked="checked" />
+
+ <select name="another[select]">
+ <option value="opt"></option>
+ </select>
</div>
+```
+```javascript
$( '#test' ).serializeObject();
+```
Returns
+```javascript
{ text1: "txt-one",
top: {
child: [ "1", "2", "3" ]
},
another: {
select: "opt"
}
-}
+}
+```

0 comments on commit 3926841

Please sign in to comment.
Something went wrong with that request. Please try again.