如果李说"事情",我想追加,但如果它说"事情",我想追加.这有可能:contains吗?
$("ul li:nth-child(2):contains('Thing')").append("foo");
Run Code Online (Sandbox Code Playgroud)
有一个不起作用:
$("ul li:nth-child(2):contains('Thing')").not(':contains("Things")').append("foo");
Run Code Online (Sandbox Code Playgroud)