P
pamelafluente
Hello. A question.
It is possible to refer to the ID of an element within the element
itself? And, if yes, what is the instruction or function.
Example. Assume I have this:
<div id="Square1" onclick = "Clicked('Square1')"></div>
You see the ID of the element "Square1" also appears later on the
function invocation "Clicked('Square1')". My question is: can I replace
the second occurrence of "Square1" with an instruction indicating the
current ID element? How?
For instance, I assume the instruction existed and were
"CurrentElmID()", I would have:
<div id="Square1" onclick = "Clicked(CurrentElmID())"></div>
Hope my question is clear. Thanks.
-Pam
It is possible to refer to the ID of an element within the element
itself? And, if yes, what is the instruction or function.
Example. Assume I have this:
<div id="Square1" onclick = "Clicked('Square1')"></div>
You see the ID of the element "Square1" also appears later on the
function invocation "Clicked('Square1')". My question is: can I replace
the second occurrence of "Square1" with an instruction indicating the
current ID element? How?
For instance, I assume the instruction existed and were
"CurrentElmID()", I would have:
<div id="Square1" onclick = "Clicked(CurrentElmID())"></div>
Hope my question is clear. Thanks.
-Pam