user6920839 user6920839 - 1 year ago 112
Javascript Question

what is this.e in javascript

I am learning to make library like jquery and trying to understand a piece of code where this.e is giving me hard time, where this 'e' come from and they are assigning object to it but when they return this they return just this not this.e .

function _(a) {
var b = {
key: "some val"
if (a) {
if (window === this) {
return new _(a)
this.e = document.getElementById(a);
return this
} else {
return b
_.prototype = {
hide: function() { = "none";
return this


<button onclick="_('abc')">click</button>
<div id="abc" style="width: 200px; height: 100px; background-color: pink;"> </div>

Answer Source

It's just a convention to use e as function parameter name when the parameter is event. as in your example here the event is onclick

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download