gpt4 book ai didi

javascript - 代码中的附加(jQuery)不起作用

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

我使用 codeigniter,但我的 JS 代码无法工作!谁能指导我吗?

Example

<select name="tour_name" style="display: none; ">
<option disabled="disabled" value="">select</option>
<option>hello</option>
<option>hi</option>
<option>what</option>
<option>how</option>
</select>
<div id="#tour_name">

JS:

$(document).ready(function () {
$('select[name="tour_name"]').change(function () {
$('#tour_name').empty();
var $val = $(this).val();
$(this).hide();
$('#tour_name').hide().fadeIn('slow').append('<b>' + $val + '</b>')
$('#tour_name b').click(function () {
$('#tour_name').empty();
$('select[name="tour_name"]').fadeIn('slow')();
})
})
});

最佳答案

您的 HTML 不正确。替换

<div id="#tour_name">

<div id="tour_name">

关于javascript - 代码中的附加(jQuery)不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7429472/

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