If $('.my-element')
matches multiple element, is there a quick way to get a random element out of these?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- Disable Browser onUnload on certain links?
- how to get selected text from iframe with javascri
To get an even distribution, you can multiply random by the array count and drop the decimal with the bitwise operator.