jQuery对象永远都有返回值,所以$("someID") 总是TRUE ,IF语句没有起到任何判断作用。 if ( $("#ID").length > 0 ) { $("#ID").text("hello"); } 相关文章: 2022-12-23 2022-02-13 2022-12-23 2022-12-23 2021-11-28 2021-12-27