Hi,
I am learning how to use event in javascript and I have a basic question about passing an event object.
I know that the following is the basic method (for Firefox anyway)
But what if I want to pass another parameter, such a string? How would the following work?
How can I make this code work? Thank you very much.
Regards,
Min
I am learning how to use event in javascript and I have a basic question about passing an event object.
I know that the following is the basic method (for Firefox anyway)
Code:
<script>
function processEvent(e){
alert(e.clientX);
}
</script>
<html>
<input type="button" value="Click" onclick="processEvent()">
</html>
But what if I want to pass another parameter, such a string? How would the following work?
Code:
<script>
function processEvent(str,e){
alert(str + " " + e.clientX);
}
</script>
<html>
<input type="button" value="Click" onclick="processEvent(str)">
</html>
Regards,
Min