http://www.w3school.com.cn/jsref/jsref_replace.asp 裏面說的很詳細 提一點 regexp : 正則表達式 在文章中 所有的要被替換的內容都添加了/xxxx/ 這樣的兩條斜槓
這段選擇器的意思爲 a標籤的href屬性中包含#但不能只有# 舉例如下 <a href="#step1">yes</a> <a href="page.php#step2">yes</a> <a href="#">no</a>