jquery选择专注于页面加载(onLoad?) [英] Jquery Chosen focus on page load (onLoad?)

查看:88
本文介绍了jquery选择专注于页面加载(onLoad?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在选择框中使用了Jquery Chosen插件,但是我想将它集中在页面加载上。我使用了下面的代码来集中一个文本输入:

I'm using the Jquery Chosen plugin on a select box, however I'd like to focus this on page load. I've used the following code to focus a text input:

onLoad="document.forms.sales_order_form.customer.focus()"

但这不适用于选择框:

<select data-placeholder="Select a Customer..." class="chzn-select" name="customer" style="width:400px;">
    <option value=""></option>
</select>


推荐答案

p>

In Chosen 1.0, this command is now:

$('.my_select_box').trigger('chosen:activate');

请参阅这里

这篇关于jquery选择专注于页面加载(onLoad?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆