jquery size() method
Translation results:
size
UK[saɪz] 美[saɪz]
n. Scale; size, size; glue, paste; huge, large amount
vt. Arrange according to size; change the size of; apply glue, sizing; apply paint
adj. Certain size
jquery size() methodsyntax
Function: size() method returns the number of elements matched by the jQuery selector.
Syntax: $(selector).size()
jquery size() methodexample
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ alert($("li").size()); }); }); </script> </head> <body> <button>输出 li 元素的数目</button> <ul> <li>Coffee</li> <li>Milk</li> <li>Soda</li> </ul> </body> </html>
Click the "Run instance" button to view the online instance
Popular Recommendations
- What Are Google Drive File Size Limit & Upload Size Limit?
- Do you use text-size-adjust in your global styles?
- United States Token Platform Market Size, Share, Analysis, and Forecast Report 2023-2030
- Global Coin-Operated Laundry Machines Market Size, Share, Revenue, Growth Rate, and Forecast to 2031
- IFA 2024 | TCL\'s NXTPAPER 14 won\'t match the Galaxy Tab S10 Ultra in performance, but it nearly matches it in size
- Xiaomi launches new transparent power bank with 212W fast charging support