例如,对于
this.parentNode
,我想只写this.p
,或者使用document.g('someid')
代替document.getElementById('someid')
。当然,这只是简单的例子,我想知道正确的做法。
(我知道可以使用jQuery或Prototype,但我想学习JS中真正的方法)
HTMLElement.prototype.…
时,您无法像使用String.prototype.…
一样使用this
或self
来定位元素 :( - iiic