Can I get the ID of an HTML element in a javascript function without passing any parameters?

Can I get the ID of an HTML element in a javascript function without passing any parameters?

I have an HTML element:

<input type="text" id="exampleInput" value="0" onkeypress="exampleFunction()">

From javascript, I would like to change the value of the HTML element.

function exampleFunction{
  
}

Is it possible to achieve this without passing the ID as a parameter?

94 thoughts on “Can I get the ID of an HTML element in a javascript function without passing any parameters?”

  1. i need 30000 dollar loan, i need easy loan. i need quick loan need loan need a loan online i need home loan with bad credit, united cash advance loans, cash advances, cash advance loans, cash advance loans with bad credit. Commerce assets and liabilities financial affairs, terms of credit.

    Reply

Leave a Comment