这段 jQuery 代码是什么意思?
$('tr[id^="message"]')
这段 jQuery 代码是什么意思?
$('tr[id^="message"]')
这意味着 - 选择所有id
属性以字符串 message
开头的 tr
元素。
[]
是指元素的属性(其中 id 是一种),id^
是一个通配符,表示 id 必须以“message”开头。
$('tr // a table row
[id //having an id
^="message"]') // starting with 'message'
http://api.jquery.com/category/selectors/attribute-selectors/