gpt4 book ai didi

javascript - 如何使用 jquery 定位
  • 项目并更改其文本
  • 转载 作者:行者123 更新时间:2023-11-28 11:58:05 25 4
    gpt4 key购买 nike

    enter image description here

    我正在尝试更改“li”项目组中的“li”项目。我花了很长时间试图找到它并更改其文本,任何人都可以为我指出正确的方向。我已经尝试过以下方法

     $("#chosen-results" ).find("li").text("hide trip history");

    我知道这行不通,因为我需要更具体,但这就是我陷入困境的地方。提前致谢。

    更新 我向所有回答这个问题的人道歉 这不是下拉列表中的最后一项,抱歉造成误导。这实际上只是许多“li”列表中的一项米格尔

    最佳答案

    使用选择器中的 eq 过滤器来过滤特定的内容。

       //sets for all.
    $("#chosen-results" ).find("li").text("hide trip history");



    //sets for the second result //0 based
    $("#chosen-results" ).find("li").eq(1).text("hide trip history");

    关于javascript - 如何使用 jquery 定位 <li> 项目并更改其文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19249924/

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