jQuery
共 95 篇文章
jquery 控制 clone( )
clone( ) 克隆匹配DOM,并选中当前克隆匹配元素集合 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("b").clone().prependTo("p"); }); </script> </h…
2009-02-03 17:10 · jQuery · HTML · jQuery
jquery 控制 remove( [expr] )
remove( [expr] ) 将匹配元素集合从DOM中完全删除 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("button").click(function () { $("p").remove…
2009-02-03 16:43 · jQuery · HTML · jQuery
jquery 控制 empty( )
empty( ) 删除匹配元素集合中所有子节点 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("button").click(function () { $("p").empty(); }); });…
2009-02-03 16:21 · jQuery · HTML · jQuery · JavaScript
jquery 控制 replaceAll( selector )
replaceAll( selector ) 将匹配元素集合替换选中的匹配元素集合中每一个元素。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("<b>Paragraph. </b>").replac…
2009-02-03 16:14 · jQuery · HTML · jQuery
jquery 控制 replaceWith( content )
replaceWith( content ) 用‘content’的内容替换匹配元素集合 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("button").click(function () { $(…
2009-02-03 15:42 · jQuery · HTML · jQuery
jquery 控制 wrapInner( html )
wrapInner( html ) 将‘html’内容封装在匹配元素集合中每一个元素的内容或是文本上。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").wrapInner("<b></b>")…
2009-02-03 15:28 · jQuery · HTML · jQuery
jquery 控制 wrapAll( html )
wrapAll( html ) 将‘html’的内容封装在匹配元素集合的整个集合上。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").wrapAll("<div></div>"); }); <…
2009-02-03 15:12 · jQuery · HTML · jQuery
jquery 控制 wrap(elem)
wrap(elem) 将特殊的‘elem’元素封装在匹配元素集合的每一个元素上 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").wrap(document.createElement("div…
2009-02-03 15:03 · jQuery · HTML · jQuery
jquery 控制 wrap(html)
wrap(html) 将‘html’的内容封装在匹配元素集合的每一个元素上。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").wrap("<div></div>"); }); </script…
2009-02-03 14:49 · jQuery · HTML · jQuery
jquery 控制 insertBefore(content)
insertBefore(content) 将匹配元素集合插入到匹配元素集合‘content’之前 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").insertBefore("#foo"); …
2009-01-13 17:25 · jQuery · HTML · jQuery
jquery 控制 insertAfter(content)
insertAfter(content) 将匹配元素集合插入至匹配元素集合‘content’之后。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").insertAfter("#foo"); /…
2009-01-13 17:21 · jQuery · HTML · jQuery
jquery 控制 before(content)
before(content) 在匹配元素集合中每一个元素之前加上新内容‘content’ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").before("<b>Hello</b>"); })…
2009-01-13 17:02 · jQuery · HTML · jQuery
jquery 控制 after(content)
after(content) 在匹配元素集合中每一个匹配元素后加上新的内容‘content’ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").after("<b>Hello</b>"); })…
2009-01-13 16:33 · jQuery · HTML · jQuery
jquery 控制 prependTo(selector)
prependTo(selector) 将匹配元素集合追加到新的匹配元素集合‘selector’之前。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("span").prependTo("#foo")…
2009-01-13 16:25 · jQuery · HTML · jQuery
jquery 控制 prepend(content)
prepend(content) 对匹配元素集合中每一个元素之前追加上新的内容‘content’ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").prepend("<b>Hello </b>"…
2009-01-13 16:18 · jQuery · HTML · jQuery
jquery 控制 appendTo(selector)
appendTo(selector) 将匹配元素集合附加到新的匹配集合‘selector’之后。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("span").appendTo("#foo"); //…
2009-01-13 16:04 · jQuery · HTML · jQuery
jquery 控制 append(content)
append(content) 将新的内容'content'附加在每一个匹配元素集合的元素后。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("p").append("<strong>Hello</s…
2009-01-12 14:46 · jQuery · HTML · jQuery
jquery 遍历 end()
end() 恢复最近一次破坏性对匹配元素集合的操作,返回到之前的匹配元素集合状态。返回匹配元素集合 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ jQuery.fn.showTags = function…
2009-01-08 17:39 · jQuery · HTML · CSS · jQuery
jquery 遍历 andSelf()
andSelf() 将之前匹配元素集合增加到当前匹配元素集合中。返回匹配元素集合 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("div").find("p").andSelf().addClass(…
2009-01-08 17:10 · jQuery · HTML · jQuery
jquery 遍历 siblings([expr])
siblings([expr]) 得到所有匹配元素集合中各个元素的所有兄弟元素集合。返回匹配元素集合 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ var len = $(".hilite").sibli…
2009-01-08 17:04 · jQuery · HTML · CSS · jQuery