Unclosed square bracket doesn't throw error in jquery
问题 $('#parent_tab [href="#tab1"').click(); The above line works fine and the tab gets selected in other browsers but not safari. I had to close the square bracket of href as follows in order to make it work in Safari. $('#parent_tab [href="#tab1"]').click(); Why did jquery not throw an error when the square bracket is not closed? 回答1: This looks like it's a Safari issue. Another reason is because the closing bracket is inside the jQuery selector. Safari might be concerned only with JavaScript