Note that there are some explanatory texts on larger screens.

plurals
  1. USArka
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. CO@Derek: I updated it with the function I originally used (removed the assumption that element.parent == body). This should clear up any confusion about the origin of my code. I also upvoted your post, because you did post a version of the correct code before me. No hard feelings.
      singulars
    2. COI'm not sure exactly what you want. Do you want me to delete my post? Do you want attribution? Do you want your post to be accepted as the "correct answer"? I didn't steal your code. Getting the location of the element in this way is not unique, it's basic logic. The top-right coordinate of any rectangle is its (x + width, y). You could figure that out by just drawing a picture. I still dispute that I have "almost the same thing". There are very few correct ways to do something. Searching "javascript find element coordinates" would produce practically the same code when parent == body.
      singulars
    3. COI will concede the `<span>` point: our codes do look similar in that respect, but I still did not "steal" it from you. `<span>` is not a unique concept or idea, it has been known for quite some time that `<span>` provides an easy way to reference certain parts of text (cf: http://www.w3schools.com/tags/tag_span.asp "manipulate with ... JavaScript" "add a hook to a part of a text" "no visual change"). As for `querySelector`, I do not believe that constitutes as similar. The method of creating a new id for the `span` element doesn't seem similar to querySelector or the syntax for querySelector.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload