I made a simmple example at fidle.
https://jsfiddle.net/johi123/0xdvq3wp/10/
from my project:
Always say me there is no id set.
url:
https://hiti-seo.com/seo-suchmaschinen-optimierung/news/seo-news.html#MUM – Eine neue Ära der Suche beginnt
console message:
Uncaught TypeError: $(…).offset() is undefined
I don’t know why it"s say Problem is at $(”)offset, the problem is the second headline id ="#MUM – Eine neue Ära der Suche beginnt" who i set.
2
Answers
Its the empty space in the id , that was the Problem .
Anyway thank you for try to help.
I think you should give the name of the attribute:
var wichid=$('li:eq(0)').attr();
=>
var wichid=$('li:eq(0)').attr("id");