HTML and CSS Reference
In-Depth Information
In order to interact with these, click on the Console tab and type:
> evt
This will display the event object, which can be opened up to show its properties:
In addition, we can execute our own code here if we would like to try something out. Any
code we type will use the local variables currently in scope. For instance, we can execute
the following code to obtain the id of the element that has been clicked:
> $(evt.target).attr("id")
We can even change objects in scope, for instance, we could add a new attribute to the ele-
ment:
> $(evt.target).attr("data-test", "test")
This provides an excellent environment in which to write snippets of code, because you re-
ceive immediate feedback from the browser on each line of code you write.
We can also examine the current call stack. This is the list of calls that have led to this line
of code being called:
You can then click on any of the function calls in the stack, and Chrome will take you to
that line of code. Once you are taken to that line of code you will have access to the envir-
Search WWH ::




Custom Search