gpt4 book ai didi

javascript - 有没有办法在下拉列表中使用来自 正文字段的信息?

转载 作者:行者123 更新时间:2023-11-30 11:23:51 26 4
gpt4 key购买 nike

这是我想放在下拉菜单中的代码。

<tbody id="todoist_table_list_tbody">
<tr>
<td field='task_name'><a href="" field="task_link">Title </a></td>
<td field='task_priority'>Priority</td>
<td field='task_due_date'>Due Date</td>
<td field='task_created_date'>Date Added</td>
<td>
<button class="btn btn-sm btn-primary pull-right m-t-n-xs"
field='delete_task' type="submit"><strong>Delete</strong></button>
<button class="btn btn-sm btn-primary pull-right m-t-n-xs"
field='start_timer' type="submit"><strong>Start</strong></button>
<button class="btn btn-sm btn-danger pull-right m-t-n-xs"
field='stop_timer' type="submit"><strong>Stop</strong></button>
</td>
</tr>
</tbody>

我有一个现有的主体,所有这些都根据哪一行工作。我想将所有这些放在下拉列表中以选择我想要的任何节点。

function end_timer(){
if (timer_instance_dictionary != null){
timer_instance_dictionary['end_time'] = moment().format()
historical_times.push(timer_instance_dictionary)
timer_instance.set({})
clearInterval(timer_interval)
}
}

$("button[field='start_timer']").click( function(){
end_timer()
task_id = $(this).closest("tr").attr("id")
upload_dictionary = current_tasks_dictionary[String(task_id)]
upload_dictionary['start_time'] = moment().format()
upload_dictionary['task_id'] = task_id
timer_instance.set(upload_dictionary)
})

$("button[field='stop_timer']").click( function(){
end_timer()
})

$("button[field='delete_task']").click( function(){
task_id = $(this).closest("tr").attr("id")
upload_dictionary = current_tasks_dictionary[String(task_id)]
upload_dictionary['deleted_time'] = moment().format()
archived_tasks.push(upload_dictionary)
todoist_delete_task(task_id)
alert(task_id)
})

最佳答案

function endTimer() {
console.log("ended timer");
// End timer code here
}
function startTimer() {
console.log("started timer");
// Start timer code here
}
function stopTimer() {
console.log("stopped timer");
// Stop timer code here
}
$(".choice").change(function() {
if ($(this).val()==="Start") {
startTimer();
} else if ($(this).val()==="Stop") {
stopTimer();
} else if ($(this).val()==="End") {
endTimer();
}
});
$(".choice2").change(function() {
var $val=$(this).val();
if ($val==="Start") {
startTimer();
} else if ($val==="Stop") {
stopTimer();
} else if ($val==="End") {
endTimer();
}
$(".choice2").each(function() {
$(this).val($val);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select class='choice'><option>Timer Options</option><option>Start</option><option>Stop</option><option>End</option></select>
<select class='choice'><option>Timer Options</option><option>Start</option><option>Stop</option><option>End</option></select>
<select class='choice'><option>Timer Options</option><option>Start</option><option>Stop</option><option>End</option></select>
<select class='choice2'><option>Timer Options</option><option>Start</option><option>Stop</option><option>End</option></select>
<select class='choice2'><option>Timer Options</option><option>Start</option><option>Stop</option><option>End</option></select>
<select class='choice2'><option>Timer Options</option><option>Start</option><option>Stop</option><option>End</option></select>
根据您的需要,我认为选择 1 类和选择 2 类显示对您有用的功能。

关于javascript - 有没有办法在下拉列表中使用来自 <tr> 正文字段的信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48776286/

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