how can i capture the element that did an event and save it a $_SESSION['name']? | Sololearn: Learn to code for FREE!

+1

how can i capture the element that did an event and save it a $_SESSION['name']?

12/5/2016 10:41:29 AM

Diego Serra

4 Answers

New Answer

+1

when you call the function on JavaScript, you can add a paramether, and send (this), wich is, a reference to the object.

+1

You can also use the "event.target" : function wichObj(event) { //other stuff your code do alert(event.target.tagName); //other stuff your code do }

0

can u explain me that with code pls?

0

But i want to get the event and save it on a SESSION VARIABLE like this function getFunction(event){ <?php $_SESSION['var'] = event.srcElement.innerHTML ; ?> }