开发者

getting the e parameter from inline javascript

I want to insert an onkeydown directly as an attribute of an input tag.

problem is that i can't figure out a way to pass the event parameter?

(I know t开发者_如何学编程hat if we use addEventHandler and stuff like that we can pass the events parameter but in this case i'm restricted to just directly modifying the attribute of an element tag.

I also cannot insert any arbitrary <script > tags


<input type="text" onkeydown="alert(event.keyCode)" />

That should work fine in W3C compliant browsers. The event object is created automatically (although I'm not sure if it will work in IE).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜