Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的函数中多次使用相同的元素。例如:
var myElement = jQuery('#some_div_with_good_id'); var myChildren = jQuery('#some_div_with_good_id span');
那么如何优化此代码以缩短第二个变量?我试过:
var myChildren = jQuery(myElement, 'span');
但这不起作用:(我是jQuery的新手,如果你认为这是个愚蠢的问题,很抱歉。
换个方式试试,jQuery('span', myElement)应该可以的。
jQuery('span', myElement)
var children = $( element ).children( 'span' );
i am getting this error in my chrome console.username availaibility is workig fine. but password strength is not working. i m new in javascript please help me..
1 java - 在android中使用自定义适配器的Listview
1 android - android Volley,RequestQueue中cancelAll和stop方法有什么区别
1 facebook - Facebook (#506) 重复状态消息
1 android - 与其他设备共享安卓屏幕
0 magento - magento 创建产品属性以通过安装程序脚本上传图像
2 java - 我的代码有什么问题?线程“main”中的异常 java.lang.NoClassDefFoundError: song (wrong name: Song)
3 javascript - 如何摆脱 Connect 3.0 弃用警报?
2 c++ - 查找最大值和最小值的 C++ 函数
3 android - Android Espresso NoMatchingViewException 检查
Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641