0

I inherited this project built in Jekyll with Bootstrap CSS. The Javascript console keeps indicating the following error:

Syntax error, unrecognized expression: .bs-docs-container [href=#]

Pretty sure this js is causing the error:

a(".bs-docs-container [href=#]").click(function(a){
    a.preventDefault()
})

But it's been a long time since I've done any javascript and I am not sure how to debug this. This looks like it is simply canceling the event if the ` when it is within a div referencing .bs-docs-container.

Any help would be appreciated.

PruitIgoe
  • 6,166
  • 16
  • 70
  • 137

2 Answers2

1

You need to quot hash mark

a(".bs-docs-container [href='#']")
ponury-kostek
  • 7,824
  • 4
  • 23
  • 31
1
a(".bs-docs-container [href='#']").click(function(a){
    a.preventDefault()
})

Mind the single quotes around the hash

Khodor
  • 996
  • 1
  • 6
  • 13