Skip to content

Instantly share code, notes, and snippets.

@andych008
Last active December 5, 2016 08:07
Show Gist options
  • Save andych008/f23968251998754c674f6d279fa0deec to your computer and use it in GitHub Desktop.
Save andych008/f23968251998754c674f6d279fa0deec to your computer and use it in GitHub Desktop.
//点击form 中的label让其后的输入项获取焦点
$("div.form-group label").each(function () {
$(this).click(function () {
$(this).next().focus();
});
});
//选中value为1的option
$("#select_id_warehouseId option").eq(1).attr('selected', 'true');
//选中最后一项option
$(formObj.batchString).find("option:last").attr('selected', 'true');
//清空
$("#id").html("");
//清空
$("#id").empty();
//取 select的 text <input name="areaString" type="hidden">
function q_areaChange(el) {
formObj.areaString.value = $(el).find("option:selected").text();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment