Home > Net >  Jquery Problems with set an id attribute and use the id for a scroll function
Jquery Problems with set an id attribute and use the id for a scroll function

Time:03-27

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.

CodePudding user response:

I think you should give the name of the attribute:

var wichid=$('li:eq(0)').attr();

=>

var wichid=$('li:eq(0)').attr("id");

CodePudding user response:

Its the empty space in the id , that was the Problem .

Anyway thank you for try to help.

  • Related