Code before use jQuery
1: <form name="aspnetForm" method="post" action="#" id="aspnetForm">
2: <p>jQuery, Asp.net, Java</p>
3: some text
4: <form name="form1" method="post" action="#" id="form1">
5: <span>love4all1080.blogspot.com</span>
6: <span>free-style-love.blogspot.com</span>
7: <span>solake.net</span>
8: </form>
9: some text
10: <p>code c#</p>
11: </form>
result to this
1:
2:
3: <form name="aspnetForm" method="post" action="#" id="aspnetForm">
4: <p>jQuery, Asp.net, Java</p>
5: some text
6:
7: <span>love4all1080.blogspot.com</span>
8: <span>free-style-love.blogspot.com</span>
9: <span>solake.net</span>
10:
11: some text
12: <p>code c#</p>
13: </form>
14:
jQuery code
1: $(document).ready(function() {
2: var foo = $("#form1").contents()
3: $("#form1").replaceWith(foo);
4: });
or short code
1: $(document).ready(function() {
2: $('#form1 > *').unwrap();
3: });
Categories:
jQuery
0 comments:
Post a Comment