How can I get the ID of an element and compare it to a string OR another id ?
What I would like to do exactly is make a condition that would get the element's ID and compare it to a certain string or another element's ID.
I have this piece of code right now to compare my id to another id (which obviously doesn't work):
function Something(elemid)
{
if(elemid == document.getElementById('myid').id)
{
...
}
}
Or this piece of code to compare to a string (doesn't work either):
if(elemid == mystring)
{
...
}
This is a simple problem, but still, I can't seem to find anything around here or even on other websites that would be what I am searching for.
I can't use any JQuery whatsoever, so any Javascript only anwser would be really appreciated.