Home  >  Article  >  Web Front-end  >  Summary of commonly used tags in HTML5

Summary of commonly used tags in HTML5

巴扎黑
巴扎黑Original
2017-06-16 17:15:081480browse

1. Tag:
Function: The statement is the first component in the document, located before the tag.

2. Tag:
Function: This element can tell the browser that it is an HTML document.
Attributes: manifest: value (url) defines cache information for offline use.

3. Tag:
Function: The tag is used to define the head of the document. It is a container for all head elements.
Attribute: profile: value (URL) A space-separated list of URLs that contain metadata information about the page.

4. Tag: <br>Function: The element can define the title of the document. <br>Attribute: dir: value (rtl,ltr) specifies the text direction of the content in the element. <br>lang: The value (language_code) specifies the language code of the content in the element. <br>xml:lang: value (language_code) specifies the language code of the element content in the XHTML document. </p> <p>5. Tag: <body><br>Function: The element defines the body of the document. <br>Attribute:alink:value(rgb(x,x,x),#xxxxxx,colorname) is deprecated, please use style to replace it. Specifies the color of active links in the document. <br>background: value(URL) is deprecated. Please replace it with a style. Specifies the <a href="http://www.php.cn/code/8294.html" target="_blank">background image</a> of the document. <br>bgcolor: value(reb(x,x,x),#xxxxxx,colorname) is deprecated. Please replace it with a style. Specifies the background color in the document. <br>link: value(reb(x,x,x),#xxxxxx,colorname) is deprecated. Please replace it with a style. Specifies the default color for unvisited links in the document. <br>text: value(reb(x,x,x),#xxxxxx,colorname) is deprecated. Please replace it with a style. Specifies the color of all text in the document. <br>vlink: value(reb(x,x,x),#xxxxxx,colorname) is deprecated. Please replace it with a style. Specifies the color of visited links in the document. </p> <p>6. Tags: <h1> to <h6> Tags <br>Function: <h1>-<h6> tags define titles. <h1> defines the largest title, <h6> defines the smallest title. <br>Attribute:align:value(left,center,right,justify) is not recommended. Please replace it with a style. Specifies the arrangement of text in titles. </p> <p>7. Tag:<p><br>Function: Tag defines paragraph. <br>Attribute:align:value(left,center,right,justify) is not recommended. Please replace it with a style. Specifies the arrangement of text in the title. </p> <p>8. Tag:<br><br>Function: A simple line break can be inserted. <br>Attributes: No optional attributes. </p> <p>9. Tag: <hr><br>Function: The tag creates a horizontal line in the HTML page. <br>Attribute:align:value(center,left,right) is deprecated. Please replace it with a style. Specifies the alignment of the hr element. <br>noshade: value (noshade) is deprecated. Please replace it with a style. Specifies that the color of the hr element is rendered as a solid color. <br>size:value(pixels) is deprecated. Please replace it with a style. Specifies the height (thickness) of the hr element. <br>width: value (pixels %) is deprecated. Please replace it with a style. Specifies the width of the hr element. </p> <p>10. Tag <!-- --><br>Function: The comment tag is used to insert comments in the source document. <br>Attributes: No optional attributes. </p> <p>11. Tag: <ul><br>Function: Tag defines an unordered list. <br>Attribute:compact:value(compact) is deprecated. Please replace it with a style. Specifies that the list should be rendered smaller than normal. <br>type: value (disc, square, circle) is deprecated. Please replace it with a style. Specifies the type of bullets for the list. </p> <p>12. Tag:<ol><br>Function: Tag defines an ordered list. <br>Attribute: compact: value (compact) Not supported in HTML5. Deprecated in HTML4.01. Specifies that the list should be rendered smaller than normal. <br>reversed: The value (reversed) specifies that the order of the list is descending order. (9,8,7...)<br>start: The value (number) specifies the starting value of the ordered list. <br>type: value (1,A,a,I,i) specifies the type of tag used in the list. </p> <p>13. Tag:<li><br>Function: Tag defines list items. The <li> tag can be used in ordered lists (<ol>) and unordered lists (<ul>). <br>Attribute:type:value(A,a,I,i,1,disc,square,circle) is deprecated. Please use a style instead. Specify which bullet points to use. <br>value: value (number) is deprecated. Please use a style instead. Specifies the number of list items. </p> <p>14. Tag: <dl><br>Function: The tag defines the definition list. Tags are used to combine <dt> (defines the item in the list) and <dd> (describes the item in the list). <br>Attributes: No optional attributes. </p> <p>15. Tag:<dt><br>Function: Tag defines the items in the definition list. <br>Attributes: No optional attributes. </p> <p>16. Tag: <dd><br>Function: Define the definition part of the entry in the definition list. <br>Attributes: No optional attributes. </p> <p>17. Tag:<a><br>Function: Tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the <a> element is the href attribute, which indicates the target of the link. <br>Attribute: charset: value (char_encoding) is not supported in HTML5. Specifies the character set of the linked document. <br>coords: Values ​​(coordinates) are not supported in HTML5. Specifies the coordinates of the link. <br>download: The value (filename) specifies the hyperlink target to be downloaded. <br>href: value (URL) specifies the URL of the page to which the link points. <br>hreflang: The value (language_code) specifies the language of the linked document. <br>media: The value (media_query) specifies the media/device for which the linked document is optimized. <br>name: value (section_name) is not supported in HTML5. Specifies the name of the anchor. <br>rel: value (text) specifies the relationship between the current document and the linked document. <br>rev: value (text) is not supported in HTML5. Specifies the relationship between the linked document and the current document. <br>shape: value (default, rect, circle, poly) is not supported in HTML5. Specifies the shape of the link. <br>target: Value (_blank, _parent, _self, _top, framename) specifies where to open the linked document. <br>type: value (MIME type) specifies the MIME type of the linked document. </p> <p>18. Tag:<nav><br>Function: The tag defines the part of the navigation link. <br>Attributes: No optional attributes. </p> <p>19. Tag: <table><br>Function: Tag defines HTML table. <br>Attribute:align:value(left,center,right) is deprecated. Please use styles instead. Specifies the alignment of the table relative to surrounding elements. <br>bgcolor: value(rgb(x,x,x),#xxxxxx,colorname) is deprecated. Please use styles instead. Specifies the background color of the table. <br>border: value (pixels) specifies the width of the table border. <br>cellpadding: value (pixels %) specifies the space between the edge of the cell and its content. <br>cellspacing: value (pixels %) specifies the space between cells. <br>frame: Value (void, above, below, hsides, lhs, rhs, vsides, box, border) specifies which part of the outer border is visible. <br>rules: Value (none, groups, rows, cols, all) specifies which part of the inner border is visible. <br>summar: The value (text) specifies the summary of the table. <br>width: value (% pixels) specifies the width of the table. </p> <p>20. Label:<caption><br>Function: The label defines the title of the table. The <caption> tag must be placed directly after the <table> tag. <br>Attribute:align:value(left,right,top,bottom) is deprecated. Please use styles instead. Specifies the alignment of the title. </p> <p>21. Tag:<th>Column<br>Function: Define the header cell in the table. Text inside the <th> element will be rendered as centered, bold text. <br>Attributes: abbr: value (text) specifies the abbreviated version of the content in the cell. <br>align: Value (left, right, center, justify, char) specifies the horizontal alignment of cell content. <br>axis: value (category_name) classifies the cell. <br>bgcolor: value(rgb(x,x,x),#xxxxxx,colorname) is not recommended. Please use a style instead. Specifies the background color of table cells. <br>char: value (character) specifies which character according to which content is aligned. <br>charoff: value (number) specifies the offset of the alignment character. <br>colspan: value (number) sets the number of columns that the cell can span. <br>headers: Value (idrefs) has a space-separated list of header cell IDs, providing header information for data cells. <br>height: value (pixels %) is not recommended. Please use a style instead. Specifies the height of table cells. <br>nowrap: value (nowrap) is not recommended. Please use a style instead. Specifies whether the content in the cell should be wrapped. <br>rowspan: The value (number) specifies the number of rows that the cell can span. <br>scope: value (col, colgroup, row, rowgroup) defines the method of associating header data with cell data. <br>valign: Value (top, middle, bottom, baseline) specifies the vertical arrangement of cell content. <br>width: value (pixels %) is not recommended. Please use styles instead. Specifies the width of table cells. </p> <p>22. Tag: <tr>Row<br>Function: Tag defines rows in the HTML table. <br>Attributes: align: value (right, left, center, justify, char) defines the content alignment of table rows. <br>bgcolor: value(rgb(x,x,x)#xxxxxx,colorname) is deprecated. Please use styles instead. Specifies the background color of table rows. <br>char: value (character) specifies which character to use for text alignment. <br>charoff: value (number) specifies the offset of the first alignment character. <br>valign: Value (top, middle, bottom, baseline) specifies table row content. </p> <p>23. Label: <td> Ordinary column <br>Function: Label defines the items in the definition list. Text within td elements is usually left aligned. <br>Attributes: abbr: value (text) specifies the abbreviated version of the content in the cell. <br>align: Value (left, right, center, justify, char) specifies the horizontal alignment of cell content. <br>axis: value (category_name) classifies the unit. <br>bgcolor: value(rgb(x,x,x),#xxxxxx,colorname) is deprecated. Please use styles instead. Specifies the background color of the cell. <br>char: value (character) specifies which character according to which content is aligned. <br>charoff: value (number) specifies the offset of the alignment character. <br>colspan: value (number) specifies the number of columns that the cell can span. <br>headers: The value (header_cells'_id) specifies the header related to the cell. <br>height: value (pixels %) is deprecated. Please use styles instead. Specifies the height of table cells. <br>nowrap: value (nowrap) is deprecated. Please use styles instead. Specifies whether the content in the cell should be wrapped. <br>rowspan: The value (number) specifies the number of rows that the cell can span. <br>scope: value (col, colgroup, row, rowgroup) defines the method of associating header data with cell data. <br>valign: Value (top, middle, bottom, baseline) specifies the vertical arrangement of cell content. <br>width: value (pixels %) is deprecated. Please use styles instead. Specifies the width of table cells. </p> <p>24. Tag: <img><br>Function: The img element embeds an image into the web page. <br>Attributes: Required attributes: src attribute: value (URL) specifies the URL of the displayed image and alt attribute: value (text) specifies the alternative text of the image. <br> Optional attributes: align: value (top, bottom, middle, left, right) is not recommended. Specifies how images are arranged relative to surrounding text. <br>border:value(pixels) is not recommended. Defines the border around the image. <br>height: value (pixels %) defines the height of the image. <br>hspace: value (pixels) is deprecated and defines the space on the left and right sides of the image. <br>ismap: value (URL) defines the image as a server-side image map. <br>longdesc: The value (URL) points to the URL containing the long image description document. <br>usemap: value (URL) defines the image as a client-side image map. <br>vspace: values ​​(pixels) are not recommended. Defines the whitespace at the top and bottom of the image. <br>width: value (pixels %) sets the width of the image. </p> <p>25. Tag:<audio><br>Function: The element can play sound files or audio streams. <br>Attribute: autoplay: value (autoplay) If this attribute appears, the audio will be played as soon as it is ready. <br>controls: value (controls) If this attribute appears, controls are displayed to the user, such as a play button. <br>loop: value (loop) If this attribute appears, playback will restart whenever the audio ends. <br>muted: The value (muted) specifies that the video output should be muted. <br>preload: value (preload) If this attribute appears, the audio will be loaded when the page is loaded and prepared for playback. If "autoplay" is used, this attribute will be ignored. <br>src: value (url) The audio URL to be played. </p> <p>26. Tag <video><br>Function: HTML5 specifies a standard way to include videos through the video element. <br>Attribute: autoplay: value (autoplay) If this attribute appears, the video will be played immediately after it is ready. <br>controls: value (controls) If this attribute appears, controls are displayed to the user, such as a play button. <br>height: value (pixels) sets the height of the video player. <br>loop: value (loop) If this attribute appears, playback will start again after the media file completes playback. <br>preload: value (preload) If this attribute appears, the video will be loaded when the page loads and is ready to be played. If "autoplay" is used, this attribute is ignored. <br>src: value (url) The url of the video to be played. <br>width: value (pixels) sets the width of the video player. </p> <p>27. Tag<source><br>Function: The tag is a media element that defines media resources. <br>Attribute: media: value (media query) specifies the type of media resource. <br>src: value (url) specifies the URL of the media file. <br>type: value (numeric value) specifies the MIME type of the media resource. </p> <p>28. Tag:<form><br>Function: Tag is used to create HTML forms for user input. <br>Attribute:accept:value(MIME_type) is not supported in HTML5. <br>accept-charset: The value (charset_list) specifies the form data character set that the server can process. <br>action: value (URL) specifies where to send form data when the form is submitted. <br>autocomplete: The value (on, off) specifies whether to enable the <a href="http://www.php.cn/code/6615.html" target="_blank">autocomplete</a> function of the form. <br>method: value (get, post) specifies the http method used to send form-data. <br>name: The value (form_name) specifies the name of the form. <br>target: value (_blank, _self, _parent, _top, foamname) specifies where to open the action URL. </p> <p>29. Tag:<input><br>Function: Tag is used to collect user information. <br>Attribute:accept:value(mime_type) specifies the type of file submitted via <a href="http://www.php.cn/code/6649.html" target="_blank">file upload</a>. <br>align: The value (left, right, top, middle, bottom) is deprecated. Specifies the alignment of the image input. <br>alt: value (text) defines the alternative text for the image input. <br>autocomplete: The value (on, off) specifies whether to use the autocomplete function of the input field. <br>autofocus: The value (autofocus) specifies whether the input field gets focus when the page loads. <br>checked: The value (checked) specifies that this input element should be selected when it is first loaded. <br>disabled: value (disabled) disables this element when the input element is loaded. <br>form: The value (formname) specifies one or more forms to which the input field belongs. <br>formaction: The value (url) overrides the action attribute of the form. <br>height: value (pixels %) defines the height of the input field. <br>list: value(datalist-id) refers to a datalist containing predefined options for the input field. <br>max: value (number, date) specifies the maximum value of the input field. <br>maxlength: The value (number) specifies the maximum length of characters in the input field. <br>min: value (number, date) specifies the minimum value of the input field. <br>name: value (field_name) defines the name of the input element. <br>readonly: The value (readonly) specifies that the input field is read-only. <br>size: value (number_of_char) defines the width of the input field. <br>type: value (button, checkbox, file, hidden, image, password, radio, reset, submit, text) specifies the type of input element. <br>value: Value (value) specifies the value of the input element. <br>width: value (pixels,%) defines the width of the input field. </p> <p>30. Label:<textarea><br>Function: Label defines a multi-line text input control. <br>Attribute:autofocus:The value (autofocus) specifies that the text area automatically gains focus after the page is loaded. <br>cols: value (number) specifies the visible width within the text area. <br>disabled: The value (disabled) specifies that the text area is disabled. <br>form: The value (form_id) specifies one or more forms to which the text area belongs. <br>maxlength: value (number) specifies the maximum number of characters in the text area. <br>name: value (name_of_textarea) specifies the name of the text area. <br>placeholder: value (text) specifies a short hint describing the expected value of the text area. <br>readonly: The value (readonly) specifies that the text area is read-only. <br>rows: value (number) specifies the number of visible rows in the text area. </p> <p>31. Label:<button><br>Function: The label defines a button. <br>Attribute: disabled: value (disabled) specifies that the button should be disabled. <br>form: The value (form_name) specifies that the button belongs to one or more forms. <br>name: value (button_name) specifies the name of the button. <br>type: value (button, reset, submit) specifies the type of button. <br>value: Value (text) specifies the initial value of the button. </p> <p>32. Tag:<select><br>Function: The element can create a single-select or multi-select menu. <br>Attribute:data:value(url) is used to automatically <a href="http://www.php.cn/code/5336.html" target="_blank">insert data</a>. <br>disabled: value (true, false) When this property is true, the menu will be disabled. <br>form: value (true, false) defines one or more forms to which the select field belongs. <br>multiple: value (true, false) When this attribute is true, it specifies that multiple items can be selected at one time. <br>name: value (unique_name) defines the <a href="http://www.php.cn/code/7266.html" target="_blank"> unique identifier for the drop-down list </a>. <br>size: value (number) defines the number of visible items in the menu. Not supported</p> <p>33. Label:<optgroup><br>Function: Label defines option group. <br>Attribute: label: value (text) specifies a description for the option group. <br>disabled: The value (disabled) specifies that this option group is disabled. </p> <p>34. Tag: <option><br>Function: The element defines an option in the drop-down list. <br>Attribute: disabled: value (disabled) specifies that the secondary option should be disabled when first loaded. <br>label: value (text) defines the label used when using <optgroup>. <br>selected: The value (selected) specifies that the option appears in the selected state. <br>value: Value (text) defines the option value sent to the server. </p> <p>35. Tag: form field<br>{<br> Single-line text field: <input type="text" /><br> Password text field: <input type="password" / ><br> <a href="http://www.php.cn/code/5979.html" target="_blank">Radio button</a>: <input type="radio" /><br> Multi-select button: <input type="checkbox" /><br> Hidden field: <input type="hidden" /><br> Submit button: <input type="submit" /><br> Reset button: <input type="reset" /><br> Since Define button: <input type="button" /><br> File upload: <input type="file"/><br> Multi-line text area: <textarea /><br> Drop-down list Domain: <select /><br>}</p> <p> </p> <p> Note: It may not be complete, but it is basically some commonly used ones. </p><p>The above is the detailed content of Summary of commonly used tags in HTML5. For more information, please follow other related articles on the PHP Chinese website!</p></div><div class="nphpQianMsg"><div class="clear"></div></div><div class="nphpQianSheng"><span>Statement:</span><div>The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn</div></div></div><div class="nphpSytBox"><span>Previous article:<a class="dBlack" title="The most complete collection of labels in history" href="http://m.php.cn/faq/367599.html">The most complete collection of labels in history</a></span><span>Next article:<a class="dBlack" title="The most complete collection of labels in history" href="http://m.php.cn/faq/367601.html">The most complete collection of labels in history</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>Related articles</h2><em><a href="http://m.php.cn/article.html" class="bBlack"><i>See more</i><b></b></a></em><div class="clear"></div></div><ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-6t+ed+2i-1n-4w" data-ad-client="ca-pub-5902227090019525" data-ad-slot="8966999616"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><ul class="nphpXgwzList"><li><b></b><a href="http://m.php.cn/faq/348757.html" title="Summary of Html knowledge" class="aBlack">Summary of Html knowledge</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348804.html" title="How to learn HTML quickly" class="aBlack">How to learn HTML quickly</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348873.html" title="The difference between html xhtml xml" class="aBlack">The difference between html xhtml xml</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348884.html" title="The difference between src and href attributes" class="aBlack">The difference between src and href attributes</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348902.html" title="About HTML5 and CSS replacement use" class="aBlack">About HTML5 and CSS replacement use</a><div class="clear"></div></li></ul></div></div><ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="5027754603"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><div class="nphpFoot"><div class="nphpFootBg"><ul class="nphpFootMenu"><li><a href="http://m.php.cn/"><b class="icon1"></b><p>Home</p></a></li><li><a href="http://m.php.cn/course.html"><b class="icon2"></b><p>Course</p></a></li><li><a href="http://m.php.cn/wenda.html"><b class="icon4"></b><p>Q&A</p></a></li><li><a href="http://m.php.cn/login"><b class="icon5"></b><p>My</p></a></li><div class="clear"></div></ul></div></div><div class="nphpYouBox" style="display: none;"><div class="nphpYouBg"><div class="nphpYouTitle"><span onclick="$('.nphpYouBox').hide()"></span><a href="http://m.php.cn/"></a><div class="clear"></div></div><ul class="nphpYouList"><li><a href="http://m.php.cn/"><b class="icon1"></b><span>Home</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/course.html"><b class="icon2"></b><span>Course</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/article.html"><b class="icon3"></b><span>Article</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/wenda.html"><b class="icon4"></b><span>Q&A</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/dic.html"><b class="icon6"></b><span>Dictionary</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/course/type/99.html"><b class="icon7"></b><span>Manual</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/xiazai/"><b class="icon8"></b><span>Download</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/faq/zt" title="Topic"><b class="icon12"></b><span>Topic</span><div class="clear"></div></a></li><div class="clear"></div></ul></div></div><div class="nphpDing" style="display: none;"><div class="nphpDinglogo"><a href="http://m.php.cn/"></a></div><div class="nphpNavIn1"><div class="swiper-container nphpNavSwiper1"><div class="swiper-wrapper"><div class="swiper-slide"><a href="http://m.php.cn/" >Home</a></div><div class="swiper-slide"><a href="http://m.php.cn/article.html" class="hover">Article</a></div><div class="swiper-slide"><a href="http://m.php.cn/wenda.html" >Q&A</a></div><div class="swiper-slide"><a href="http://m.php.cn/course.html" >Course</a></div><div class="swiper-slide"><a href="http://m.php.cn/faq/zt" >Topic</a></div><div class="swiper-slide"><a href="http://m.php.cn/xiazai" >Download</a></div><div class="swiper-slide"><a href="http://m.php.cn/game" >Game</a></div><div class="swiper-slide"><a href="http://m.php.cn/dic.html" >Dictionary</a></div><div class="clear"></div></div></div><div class="langadivs" ><a href="javascript:;" class="bg4 bglanguage"></a><div class="langadiv" ><a onclick="javascript:setlang('zh-cn');" class="language course-right-orders chooselan " href="javascript:;"><span>简体中文</span><span>(ZH-CN)</span></a><a onclick="javascript:;" class="language course-right-orders chooselan chooselanguage" href="javascript:;"><span>English</span><span>(EN)</span></a><a onclick="javascript:setlang('zh-tw');" class="language course-right-orders chooselan " href="javascript:;"><span>繁体中文</span><span>(ZH-TW)</span></a><a onclick="javascript:setlang('ja');" class="language course-right-orders chooselan " href="javascript:;"><span>日本語</span><span>(JA)</span></a><a onclick="javascript:setlang('ko');" class="language course-right-orders chooselan " href="javascript:;"><span>한국어</span><span>(KO)</span></a><a onclick="javascript:setlang('ms');" class="language course-right-orders chooselan " href="javascript:;"><span>Melayu</span><span>(MS)</span></a><a onclick="javascript:setlang('fr');" class="language course-right-orders chooselan " href="javascript:;"><span>Français</span><span>(FR)</span></a><a onclick="javascript:setlang('de');" class="language course-right-orders chooselan " href="javascript:;"><span>Deutsch</span><span>(DE)</span></a></div></div><script> var swiper = new Swiper('.nphpNavSwiper1', { slidesPerView : 'auto', observer: true,//修改swiper自己或子元素时,自动初始化swiper observeParents: true,//修改swiper的父元素时,自动初始化swiper }); </script></div></div><!--顶部导航 end--><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script></div><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script>jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); </script></body></html>