gpt4 book ai didi

javascript - 如何将css类调用到javascript中

转载 作者:行者123 更新时间:2023-11-27 22:58:21 26 4
gpt4 key购买 nike

我曾尝试使用该插件进行选择,但是当我在 javascript 中插入该类时,css 插件类无法正常工作:

我想使用 javascript 的插件:

 $('.search-test').SumoSelect({
search: true,
searchText: 'Please enter the appropriate keywords...',
noMatch: 'Sorry, the data you are looking for is not found, please enter the appropriate keywords, the data you are looking for: "{0}"',
// up: false
});

JavaScript 代码:

$(document).ready(function() {
var count = 0;

$(document).on('click', '.add', function() {
count++;
var html = '';
html += '<tr>';
html += "<td>"+"<select class='search-test' id='search-test'><option>a</option></select>" + "</td>";
html += '</tr>';
$('tbody').append(html);
});

$(document).on('click', '.remove', function() {
$(this).closest('tr').remove();
});

$('#insert_form').on('submit', function(event) {

var form_data = $(this).serialize();

if (error == '') {
$.ajax({
url: "request/create",
method: "POST",
data: form_data,
success: function(data) {
if (data == 'ok') {
$('#item_table').find('tr:gt(0)').remove();
$('#error').html('<div class="alert alert-success background-success">Success insert the data!</div>');
}
}
});
} else {
$('#error').html('<div class="alert alert-danger background-danger">' + error + '</div>');
}

});
});

最佳答案

我的问题解决了,我在放置jquery.min.js版本时不小心

关于javascript - 如何将css类调用到javascript中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59123063/

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