Jump to content

Getting the id from a document.element


MrFies

Recommended Posts

Hello, I didnt find something about that. Normally there is explained to get an Object with

var MyElement = document.getElementById("MyDiv");

But now I have the Object from an Event-Handler and I want to get the id. I tried

var myid = MyElement.id; //result should be "MyDiv"

Can someone give me a hint?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...