gpt4 book ai didi

jquery - 使用 jquery 设置输入样式

转载 作者:行者123 更新时间:2023-12-01 00:25:37 25 4
gpt4 key购买 nike

好的,我已经对 css 进行了排序:

现在对输入框的样式(但这不起作用)有任何建议。认为我的 js 搞砸了。html 元素:

<input name="latLng" class="latLng" id="latLng2" type="text" disabled />

JS:

<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('input.latLng').locationPicker({
width: "500px",
height: "20px",
backgroundColor: '#fff',
border: '1px solid #ccc',
borderRadius: 10,
padding: 10
});
});
</script>

请问我哪里出错了。

最佳答案

要设置样式,请使用 .css()设置元素的样式并单独调用您的插件,如下所示:

jQuery(document).ready(function(){
jQuery('input.latLng').css({
width: "500px",
height: "20px",
backgroundColor: '#fff',
border: '1px solid #ccc',
borderRadius: 10,
padding: 10
}).locationPicker();
});

或者,短一点:

jQuery(function($){
$('input.latLng').css({
width: 500,
height: 20,
backgroundColor: '#fff',
border: '1px solid #ccc',
borderRadius: 10,
padding: 10
}).locationPicker();
});

关于jquery - 使用 jquery 设置输入样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4139621/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com