4 ms·
if (document.querySelector('h1').innerHTML.match(/^Is .*\?$/)) { console.log('Probably not.') }
by noibl 14y ago
if (document.querySelector('h1').innerHTML.match(/^Is .*\?$/)) { console.log('Probably not.') }
- Aeons 14y agohttp://en.wikipedia.org/wiki/Betteridges_Law_of_Headlines http://en.wikipedia.org/wiki/Betteridges_Law_of_Headlines
- gildas 14y agoTypeError: Cannot read property 'innerHTML' of null You should use UA sniffing to fix this bug.
- noibl 14y agoHarr. :)
- driverdan 14y agoFixed: if (document.querySelector('.title a').innerHTML.match(/^Is .*\?$/)) { console.log('Probably not.') } (HN's markup is terrible, it doesn't use headers)