1.首先为需要触发enter事件的控件中添加onkeydown事件:

  支持onkeydown事件的标签为:

<a>, <acronym>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, 
<button>, <caption>, <cite>, <code>, <dd>, <del>, <dfn>, <div>, <dt>, <em>, 
<fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <input>, <kbd>, <label>, <legend>, 
<li>, <map>, <object>, <ol>, <p>, <pre>, <q>, <samp>, <select>, <small>, 
<span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, 
<th>, <thead>, <tr>, <tt>, <ul>, <var>
则,例如可以对table标签添加onkeydown事件。(此时在table中的标签用键盘输入时都会触发该事件)
<table onkeydown="keydown(event)"></table>
View Code

相关文章:

  • 2021-05-25
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-06-24
  • 2021-05-29
  • 2022-02-11
  • 2022-12-23
猜你喜欢
  • 2022-02-22
  • 2021-11-04
  • 2021-09-11
  • 2022-03-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
相关资源
相似解决方案