javascript - How to get the id of the textbox on keydown event of that textbox -


i have text box in page:

<td> <input type="text" id="approvers1" size="11" onkeydown="adduserskeydown(event)" style="width: 470px;" /> </td> 

this js function:

function adduserskeydown(evtobj) {      if (evtobj.keycode == 75 && evtobj.ctrlkey) {          addusers(--input parameter--);     } } 

now if press ctrl k in textbox must call javascript function named addusers(--input parameter--).. input parameter should id of textbox...

how achieve this.. either need id of textbox or atleast dom object can access id of textbox dom object..

kindly me in achieving either 1 of 2 things..

use this dom element or this.id id of element

<td> <input type="text" id="approvers1" size="11" onkeydown="adduserskeydown(event,this.id)" style="width: 470px;" /> </td>  function adduserskeydown(evtobj,id) {      if (evtobj.keycode == 75 && evtobj.ctrlkey) {          addusers(id);     } } 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -