jQuery中典型的方法: $('option[selected]') 不管用,因为selected并不是CSS标准. 因此,在zepto中想要获取select元素中选中的option,需采取如下方法: // get OPTION elements for which `selected` property is true $('option').not(function(){ return !this.selected }) 或者推荐 $("#ID").val() //获取选中的
最近做一个数据清理,根据行号清理,所以需要查出这个行的最大最小值出来进行删除,如果靠手动每次去查,太麻烦所以就用在sh脚本当中执行SELECT语句,并将结果赋值给一个变量. sh脚本如下 #! /bin/sh echo "Please enter the bankseq: \c" read bankseq echo "do you confirm enter the bankseq Y/N : " ; read result ; if [ "Y"
js函数方法: <script> function getDefaultSelectedOption(selectId, valIfNull) { var selectId = selectId.replace(/^#/, ''), opts; try { opts = document.getElementById(selectId).getElementsByTagName('option'); for (var i in opts) { if (opts[i].defaultSelect