How Can I find any Object when I know property value of object

I try create shortcut to icon (html element), which is object and this object has some methods for example. openWindow(), and I want that, when I will click on shortcut,this shortcut run method this object (orginal html element).

Example:

class File{
  constructor(fileName){
  this.name = fileName;
  this.element = document.createElement("div");
  this.addFile();
  }
  
  openWindow(){
    console.log("You opened", this.name);
  }
  
  addFile(){
    document.body.appendChild(this.element);
    this.element.addEventListener('click',openWindow)
  }
}

const orginalElement = new File("file1");

const shortcut = orginalElement.cloneNode(true);
shortcut.addEventListener('click', openWindow);

Maybe I should use WeakMap or something other I don’t know.
So Is any method, which can return object when I know property value of object?
Because in my code each object has ‘id’ property and thoose shortcuts has attribute ‘id’ which should be same as property id of orginal object.

96 thoughts on “How Can I find any Object when I know property value of object”

  1. I’ve been browsing online more than three hours
    as of late, but I never discovered any fascinating article like yours.
    It is pretty price sufficient for me. Personally, if all web owners and bloggers made good content material
    as you probably did, the net shall be much more useful than ever before.

    Reply
  2. I have been surfing online more than three hours today,
    yet I never found any interesting article like yours.
    It’s pretty worth enough for me. In my opinion, if all website owners and bloggers made good content as you did, the web will be a lot more useful than ever before.

    Reply
  3. It is perfect time to make some plans for the future and it
    is time to be happy. I have read this post and if
    I could I want to suggest you some interesting things or
    tips. Maybe you can write next articles referring to this article.
    I want to read more things about it!

    Reply
  4. It’s the best time to make some plans for the long run and
    it’s time to be happy. I have read this publish and if I may
    just I desire to suggest you some fascinating things or suggestions.
    Maybe you can write next articles relating to this article.
    I wish to learn even more issues about it!

    Reply
  5. I will right away seize your rss feed as I can not find
    your e-mail subscription hyperlink or newsletter service.
    Do you’ve any? Kindly permit me recognize so that I could subscribe.
    Thanks.

    Reply
  6. I’ve been browsing online more than 3 hours lately, yet
    I by no means found any attention-grabbing article like yours.
    It is pretty price sufficient for me. In my view, if all website owners and bloggers
    made good content as you probably did, the internet will probably be a lot
    more helpful than ever before.

    Reply
  7. I really love your blog.. Great colors & theme. Did you create this site yourself?
    Please reply back as I’m trying to create my own website and would like to know where you got this from or exactly what the theme is called.

    Kudos!

    Reply
  8. It’s perfect time to make some plans for the future
    and it is time to be happy. I have learn this publish and if I may just I want to recommend you few interesting things or
    suggestions. Perhaps you can write subsequent articles referring to this article.
    I desire to learn more things approximately it!

    Reply
  9. I’ve been surfing on-line greater than three hours nowadays,
    but I never discovered any attention-grabbing article like yours.
    It’s pretty value enough for me. In my view, if all website owners and bloggers
    made excellent content material as you probably did,
    the web will probably be a lot more helpful than ever before.

    Reply
  10. Three-quarters had settled ahead of some other payment approach,
    with income, though majorities had also compensated with digital
    transaction websites cards and debit cards like PayPal.

    Reply
  11. It’s appropriate time to make some plans for
    the future and it is time to be happy. I have read this post and if I could I want to suggest you some interesting things or advice.
    Maybe you can write next articles referring to this article.

    I want to read more things about it!

    Reply
  12. Its like you read my thoughts! You appear to grasp a lot approximately this, such as you
    wrote the book in it or something. I think that you could do with a few p.c.
    to pressure the message home a bit, but instead of that, this is fantastic blog.
    A great read. I’ll certainly be back.

    Reply
  13. What I have often told men and women is that when searching for a good on-line electronics retail outlet, there are a few elements that you have to factor in. First and foremost, you need to make sure to locate a reputable and in addition, reliable store that has received great testimonials and ratings from other people and marketplace professionals. This will make certain you are handling a well-known store that provides good program and aid to their patrons. Thank you for sharing your ideas on this weblog.

    Reply