+ 1
how can i capture the element that did an event and save it a $_SESSION['name']?
4 Réponses
+ 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 ; ?>
}