How do I get the value of onclick from a button using Javascript?

UPDATED - totally misunderstood your question.

UPDATED - totally misunderstood your question... You want to know if you can verify which handlers are assigned to which tags programmatically... gotcha... So if you try: document. GetElementById("myButton").onclick.toString(); You'll see that what you get is: function onclick() { YOUR METHOD NAME HERE } I'm sure you can take it from there... everything between "function onclick\n{" and "\n}" is your method. Sorry I misunderstood your question originally!B.

Just do the same, but in pure javascript: var onclick = document. GetElementByID("btn1").onclick.

You could use getAttribute: var anc = document. GetElementById("anc"); alert(anc. GetAttribute('onclick')).

Tried document. GetElementById('anc'). GetAttribute('onclick')); and it didn't work.

I didn't see getAtrribute support the onclick property, so I posted this question :( – Freakishly Jul 26 '11 at 18:58 I don't think the getAttribute cares about the name of the attribute you're trying to get.... try this jsbin. Com/etawel/edit – Jaime Jul 26 '11 at 19:17.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions